1.

What Is The Output Of This Program? 1. Class Output { 2. Public Static Void Main(string Args[]) { 3. Double X = 2.0; 4. Double Y = 3.0; 5. Double Z = Math.pow( X, Y ); 6. System.out.print(z); 7. } 8. }

Answer»

Math.pow(x, y) METHODS returns value of y to the POWER x, i:e x ^ y, 2.0 ^ 3.0 = 8.0.

OUTPUT:

$ JAVAC Output.java
$ java Output
8.0

Math.pow(x, y) methods returns value of y to the power x, i:e x ^ y, 2.0 ^ 3.0 = 8.0.

Output:

$ javac Output.java
$ java Output
8.0



Discussion

No Comment Found

Related InterviewSolutions