Home / Programming MCQs / JAVA MCQs / Question

R

Ram Sharma • 178.09K Points
Coach

Q. What is the output of the below Java program?

Code:
int balls[], rounds=3;
balls = new int[rounds];
for(int i=0; i<balls.length; i++)
    balls[i] = (i+1)*2;
for(int j=0; j<balls.length; j++)
    System.out.print(balls[j] + ",");
(A) 0,2,4,
(B) 1,2,3,
(C) 2,4,6,
(D) Compiler error

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.