Menu
Topics Index
...
`

Convert degrees to radians


If you need explanation Read this topic

If you need Answer Take test on this topic

Convert degrees to radians
What will be the output of the following program?
public class RadianTest {
    public static void main(String[] args) {
        int input = 90;
        double x = Math.toRadians(input);
        double y = ((Math.PI / 180) * input);
        Boolean result = (x == y) ? true : false;
        System.out.println(result);
    }
}

A. true
B. false
C. Compilation Error
D. 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.

ans is A  x= 11/2 and  y =11/2 so it will print true

Posted by Bheema Reddy    2014-02-06 03:35:10


option B.The values are unequal

Posted by Bhanu Teja    2014-02-06 03:39:21


A

Posted by Ravikiran Chowdary    2014-02-06 05:21:39


answer is b....because in Math.Pi value of pi is 3.141 so x=90 and y =11/ 7 ..so values are not equal so answer is false that is option B :-)

Posted by Anvesh Athmakuri    2014-02-06 13:57:37


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

Posted by Merit Campus    2014-02-07 09:04:52


© meritcampus 2019

All Rights Reserved.

Open In App