import java.util.*;
public class Ch1Q37
{
public static void main(String[] args)
{
double sarea, vol;
System.out.print("Enter radius of a sphere: ");
Scanner kbd = new Scanner(System.in);
double rad = kbd.nextDouble();
sarea = 4*Math.PI*rad*rad;
vol = Math.PI*rad*rad*rad*4/3;
System.out.println("Surface area = " + sarea);
System.out.println("Volume = " + vol);
}
}
No comments:
Post a Comment