Menu
Question Index
...

What will be the output of the following program?

public class WhichBlock {
    public static void main(String[] args) {
        int marks = 90;
        if (marks > 80) {
            System.out.println("Excellent");
            if (marks < 70) {
                System.out.println("Good");
                if (marks < 60) {
                    System.out.println("Average");
                }
            }
        }
    }
}


Excellent
Excellent
Good
Excellent
Good
Average
Compilation Error
Runtime Error

Doubts

Problems

Topic: Block Of Code 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