3
Answers

Write a program to simulate n nested loops from 1 to n.

Sara Hajrizi

Sara Hajrizi

1y
571
1

Create a recursive method Loops(int k), perform a for-loop from 1 to n and make a recursive call Loops(k-1) in the loop. The bottom of the recursion is when k < 0. Initially invoke Loops(n-1).

Answers (3)