write a program to calculate area of sphere using scanner class hint (4πr2
Answers
Answered by
3
import java.util.Scanner;
class TotalSurfaceAreaOfSphere
{
public static void main(String args[])
{
Scanner s= new Scanner(System.in);
System.out.println("Enter the radius of sphere :");
double r=s.nextDouble();
double area=(4*22*r*r)/(7);
System.out.println("Total Surface Area Of sphere is:" +area);
}
}
Answered by
1
Please refer the attached image
Attachments:
Similar questions