How to calculate 4th root in Java

2 Answers

0 votes
public class MyClass {
    public static void main(String args[]) {
        double root4th, n = 100; 
        
    	root4th = Math.pow(n, (0.25));   
    	
    	System.out.println(root4th);  
    }
}




/*
run:

3.1622776601683795

*/

 



answered Mar 26, 2021 by avibootz
0 votes
public class MyClass {
    public static void main(String args[]) {
        double root4th, value = 100; 

    	root4th = Math.pow(value, 1.0 / 4);

    	System.out.println(root4th);  
    }
}




/*
run:

3.1622776601683795

*/

 



answered Mar 26, 2021 by avibootz

Related questions

...