Java program to calculate the power of a number using pow() function.

public class Power {
    public static void main(String[] args) {
        int base = 3, exponent = -4;
        double result = Math.pow(base, exponent);
        System.out.println("Output = " + result);
    }
}
Java program to calculate the power of a number using pow() function. Java program to calculate the power of a number using pow() function. Reviewed by on December 20, 2019 Rating: 5

No comments:

Powered by Blogger.