Menu
Question Index
...

What will be the output of the following program?

public class ValueOfValue
{
    public static void main(String s[])
    {
        double value = Math.round (2.5 + Math.random());
        System.out.println("Output is: " + value);
    }
}


Output is: 2
Output is: 3
Output is: 4
Can not be predicted
Compilation Error or 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