Home » JAVA Programming » Methods » Question
  1. What is the output of this program?
    public class Output 
    {
    public static void main(String args[])
    {
    double num0 = 5.0;
    double num1 = 2.0;
    double num2 = Math.pow( num0, num1 );
    System.out.print(num2);
    }
    }
    1. 5
    2. 2
    3. 25
    4. 25.0
    5. 52
Correct Option: D

Math.pow(num0, num1) methods returns value of num1 to the power num0, i:e num0 ^ num1, 5.0 ^ 2.0 = 25.0



Your comments will be displayed only after manual approval.