Write a java program to calculate the side of cube taking its volume as an input. Hint: side of a cube ³√volume.
Answers
Answered by
0
Answer:
According to the question we have to take volume as a input and then calculate the side of the cube.
in math terms we know that the cube root of volume gives the side of a cube.
Code:
import java.util.*;
class cube
{
public static void main()
{
Scanner sc = new Scanner ( System.in);
System.out.println("enter the volume of the cube');
int v = sc.nextInt();
double a= Math.cbrt(v);
System.out.println(" Volume of cube="+ v);
System.out.println(" Side of cube="+ a);
}
}
Note: The Math.cbrt methods returns the cube root of a number given as its arguments
Kindly click the following link for more understanding:
https://brainly.in/question/12779192
#SPJ1
Similar questions