0
What is the output of the following Java program?
public class Main {
public static void main(String[] args) {
for (int i = 0; i < 3; i++) System.out.print(i * i + " ");
}
}- A1 4 9
- B0 1 4
- C0 1 2
- D1 2 3
Correct answer: B
What is the output of the following Java program?
public class Main {
public static void main(String[] args) {
for (int i = 0; i < 3; i++) System.out.print(i * i + " ");
}
}