The volume of a sphere is calculated by using formula:v = (4/3)*(22/7)*r3Write a program to calculate the radius of a sphere by taking its volume as an input.Hint: radius = ∛(volume * (3/4) * (7/22))
Answers
import java.util.Scanner;
public class Circle {
public static void main(String[ ] args) {
System.out.print("Enter the volume of the Sphere - ");
double volume = new Scanner(System.in).nextDouble( );
System.out.println("Radius of the Sphere - " + Math.cbrt(volume * (3d / 4d) * (Math.PI)));
}
}
Answer:
Import java.util.Scanner;
public class Circle
{
public static void main(String[ ] args)
{
System.out.print("Enter the volume of the Sphere - ");
double volume = new Scanner(System.in).nextDouble( );
System.out.println("Radius of the Sphere - " + Math.cbrt(volume * (3d / 4d) * (Math.PI)));
}
}
HOPE IT HELPS