R
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] + ",");
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] + ",");
- Correct Answer - Option(C)
- Views: 391
- Filed under category JAVA
Discusssion
Login to discuss.