What is the output of the following code snippet?
int n = 5;
for (int i = 0; i < n; i++) {
System.out.print(i + " ");
}
for (int i = 0; i < n; i++) {
System.out.print(i + " ");
}
A. 5 4 3 2 1
B. 0 1 2 3 4
C. 1 2 3 4 5
D. 5 4 3 2 1 0
Answer: Option B
Join The Discussion