Menu
Question Index
...

What will be the output of the following program?

class IfExample
{
    public static void main(String s[])
    {
        if( 1 > 2 )
        {
            System.out.println(" 1 is greater than 2");
        }
        else
            System.out.println(" 2 is greater than 1");
        
    }
}


"No output".
1 is greater than 2
2 is greater than 1
Compilation Error

Doubts

Problems

Topic: if Condition 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