Examveda
Examveda

What is the output of the following code snippet?

int n = 5;
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

Answer: Option B


This Question Belongs to Java Program >> Flow Control

Join The Discussion

Related Questions on Flow Control