Q72
What will be the output of the following Java program? class Output public static void main(String args[]) int arr[] = 1, 2, 3, 4, 5; for ( int i = 0; i < arr.length - 2; ++i) System.out.println(arr[i] + " ");
A.
1 2
B.
1 2 3
AnswerC.
1 2 3 4
D.
1 2 3 4 5
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board