Menu
Question Index
...

What will be the output of the following program?

class ForSample
{
    public static void main(String s[])
    {
        for(int i = 10; i <= 5; i-- )
        {
            System.out.println("i = " + i );
        }
    }
}


i = 10
i = 9
i = 8
i = 7
i = 6
i = 10
i = 9
i = 8
i = 7
i = 6
i = 5
i = 4
i = 3
i = 2
i = 1
Compilation Errors
No Output

Doubts

Problems

Topic: for Loop In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App