1.

What Is The Output Of This Program? 1. Class Output { 2. Public Static Void Main(string Args[]) { 3. Double X = 3.14; 4. Int Y = (int) Math.todegrees(x); 5. System.out.print(y); 6. } 7. }

Answer»

3.14 in degree 179.9087. We usually take it to be 180. Buts here we have TYPE casted it to INTEGER DATA type hence 179.

Output:

$ javac Output.java
$ java Output
179

3.14 in degree 179.9087. We usually take it to be 180. Buts here we have type casted it to integer data type hence 179.

Output:

$ javac Output.java
$ java Output
179



Discussion

No Comment Found

Related InterviewSolutions