Question 1
What will be the output of the following code?
Answer saved
Flag
question
public class Main {
public static void main(String[] args) {
=
int] arr {1, 2, 3, 4, 5};
for(int i = 0; i < arr.length; i++) {
arr[i] = arr[i] *2;
}
for(int i: arr) {
System.out.print(i + " ");
}
}
}
A. 12345
B. 24 6 8 10 12
C. 24 6 8 10
D. 149 16 25
Clear my choice