Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

hwo to calculate cuberoot of numbers in java

import java.lang.Math;

public class MyClass {
  public static void main(String[] args) {
		double x = 64;
		double y = 125;

		//cbrt() takes double datatype as argument
		double x1 = Math.cbrt(x);
		double y1 = Math.cbrt(y);
		System.out.println("Cube root of " + x + " is " + x1);
		System.out.println("Cube root of " + y + " is " + y1);
  }
}
Source by www.alphacodingskills.com #
 
PREVIOUS NEXT
Tagged: #hwo #calculate #cuberoot #numbers #java
ADD COMMENT
Topic
Name
1+1 =