This is a Java Program to Find the Volume and Surface Area of Sphere.
Sphere Volume = 4/3 * π * r3
Sphere Surface Area = 4 * π * r2
Here is the source code of the C# Program to Find the Volume and Surface Area of Sphere. The C# program is successfully compiled and run on a Windows system.
The program output is also shown below.
static void Main(string args)
double area, volume, pi = 3.14;
Console.Write("Enter the radius of sphere: ");
r = Convert.ToInt32(Console.ReadLine());
area = 3 * pi * r * r;
volume = 1.333 * pi * r * r * r;
Console.WriteLine("Surface Area of sphere:" + area);
Console.WriteLine("Volume of sphere:" + volume);