Menu
Question Index
...

What will be the output of the following program?

public class Search {
    public static void main(String[] args) {
        double attendance = 99.01;
        float percentage = 75.02f;
        double gateScore = -13.99;
        double searchResult = 0.12;
        System.out.println("Search result in sec " + Math.floor(searchResult));
        System.out.println("Attendance " + Math.floor(attendance));
        System.out.println("Percentage " + Math.floor(percentage));
        System.out.println("GATE Score " + Math.floor(gateScore));
    }
}


Search result in sec 0.1
Attendance 99.0
Percentage 75.0
GATE Score -13.0
Search result in sec 1.0
Attendance 100.0
Percentage 76.0
GATE Score -13.0
Search result in sec 0.0
Attendance 99.0
Percentage 75.0
GATE Score -14.0
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Math Class - java.lang.Math

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App