English

Give the output of the following program segment and also mention how many times the loop is executed : int i; for (i = 5; i > 10; i++) System.out.println(i); System.out.println(i * 4);

Advertisements
Advertisements

Question

Give the output of the following program segment and also mention how many times the loop is executed : 

int i; 
for (i = 5; i > 10; i++) 
System.out.println(i); 
System.out.println(i * 4);
One Line Answer
Advertisements

Solution

20. Loop will be executed for 0 times. 

shaalaa.com
Introduction of Nested Loop
  Is there an error in this question or solution?
Chapter 1.09: Iterative Constructs in Java - EXERCISES [Page 123]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.09 Iterative Constructs in Java
EXERCISES | Q III. 6. | Page 123
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×