What will be the output of the following program?

Last Updated :
Discuss
Comments

What will be the output of the following program?

Java
int[] arr = {10, 20, 30, 40, 50};
for (int i : arr) {
    System.out.print(i + " ");
}

10 20 30 40 50

0 0 0 0 0

Compilation Error

10 10 10 10 10


Share your thoughts in the comments