Menu
Topics Index
...
`

Search student details


If you need explanation Read this topic

If you need Answer Take test on this topic

Search student details
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.ceil(searchResult));
        System.out.println("Attendance " + Math.ceil(attendance));
        System.out.println("Percentage " + Math.ceil(percentage));
        System.out.println("GATE Score " + Math.ceil(gateScore));
    }
}

A. Search result in sec 0.1
Attendance 99.0
Percentage 75.0
GATE Score -13.0
B. Search result in sec 1.0
Attendance 100.0
Percentage 76.0
GATE Score -13.0
C. Search result in sec 0.0
Attendance 99.0
Percentage 75.0
GATE Score -14.0
D. Compilation Error
E. Runtime Error
Topic: Java Math Class - java.lang.Math

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

B is ans.as Math.ceil rounds attendance 99.01 to 100
and gate to -13

Posted by Shabaaz Shaikz    2014-06-03 13:03:58


Answer : B
Math.ceil() rounds off the values to its upper bound.

Posted by Sreemukha Taduru    2014-06-03 14:05:49


Congratulations Shabaaz Shaikz. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-06-04 04:49:19


© meritcampus 2019

All Rights Reserved.

Open In App