R

Ram Sharma • 193.86K 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
  • Correct Answer - Option(C)
  • Views: 358
  • Filed under category JAVA

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.

Be the first to start discuss.


Question analytics