Menu
Question Index
...

What will be the output of the following program?

class StudentPass
{
    public static void main(String s[])
    {
        int marks = 80;

        if( marks > 70 )
            System.out.println("Distinction");
            System.out.println("Congratulations");
        else if( marks > 35 )
            System.out.println("Pass");
        else
            System.out.println("Fail");
            System.out.println("Better luck next time");
        
    }
}


Pass
Distinction
Congratulations
Pass
Distinction
Congratulations
Distinction
Compilation Errors

Doubts

Problems

Topic: if else if ladder 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