Two integers, A and B, are randomly generated by the program. You need to display all integers from A to B
inclusive, in ascending order, if A is less than B, or in descending order otherwise.
The task is implemented using recursion.
Replace recursion
- 16
Locked
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Justin Smith
26 June 2022, 21:05
Give yourself an extra challenge (because this is Java Syntax level stuff):
Only one for-loop that covers both a>b and b>a
It can be done, but requires an unusual approach for the 3rd statement of the for-loop.
0