Question

# Program to calculate the surface area of the sphere.

# Share code with your friends

Share on whatsapp

Share on facebook

Share on twitter

Share on telegram

Code

` ````
```import java.util.Scanner;
public class surfaceAreaOfSphere
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter radius of circle");
double r=sc.nextDouble();
double pi=22/7;
/*Formula of surface area of sphere =4*pi* (radius of sphere)^2)*/
double area=4*pi*r*r;
System.out.println("surface Area of sphere="+area);
}
}