Recursive Method With A For Loop
Consider the following method.
public static void loopRecursion(int n) {
if(n <= 0) return;
for(int i = 0; i < n; i++){
System.out.print(i);
}
loopRecursion(n - 1);
}
What is printed to the console as a result of the call loopRecursion(3)?
A
012012
B
01210
C
012010
D
0120
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | tykenjcruz | 1 | 1 | 0m 00s | 100 |
| #2 | singhris000 | 1 | 1 | 0m 49s | 51 |
| #3 | richa.tuli | 0 | 1 | 2m 54s | -184 |
APFIVE