English

Give the output of the following program segment: for (i = 5; i <8; i--) System.out.println(i + 1);

Advertisements

Question

Give the output of the following program segment:

for (i = 5; i <8; i--)
System.out.println(i + 1);

Very Short Answer
Advertisements

Solution

Output:

6
5
4
3
2
1
0
-1 ...

shaalaa.com
  Is there an error in this question or solution?
Chapter 7: Statements and their Scope - EXERCISE [Page 164]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 7 Statements and their Scope
EXERCISE | Q 13. (ii) | Page 164
Advertisements
Share
Notifications



      Forgot password?
Use app×