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");
        if( marks > 35 )
            System.out.println("Pass");
        else
            System.out.println("Fail");
            System.out.println("Better luck next time");
        
    }
}


Pass
Distinction
Pass
Better luck next time
Distinction
Pass
Distinction
Fail
Better luck next time

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