Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Java All : Compound or Nested Loops


Exam Paper Problems

Output writing and loop counting #7248

( As In Exam - ICSE2017 )

Analyze the given program segment and answer the following questions:

Analyze the given program segment and answer the following questions:

for(int i=3;i<=4;i++ ) {
for(int j=2;j<i;j++ ) {
System.out.print(“” ); }
System.out.println(“WIN” ); }

(i) How many times does the inner loop execute?
(ii) Write the output of the program segment.



Exam Paper Problems:1 
Back