write a program in java to input radius of sphere , then calculat and display volume and area of sphere
Answers
Answered by
0
Explanation:
import java.util.*;
public class Print
{
void main
{
Scanner sc= new Scanner(System.in);
System.out.println("Input the radius");
int rad = sc.nextInt();
double area = 4*3.142*rad*rad;
double volume = 4/3 * 3.142*rad*rad*rad;
System.out.println("Area is"+area);
System.out.println("Volume is"+volume);
}
}
Similar questions