How to use pow function in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String[] args) {
        double a = 40; 
        double b = 2; 
        
        System.out.println(Math.pow(a, b)); 
  
        a = 3; 
        b = 5; 
        System.out.println(Math.pow(a, b)); 
    }
}
 
 
 
/*
run:
 
1600.0
243.0
 
*/

 



answered Mar 23, 2021 by avibootz

Related questions

...