c#,volume,surface,area,sphere

Ron 8/15/2016 0

This Code Shows How to find Volume and Surface Area of a Sphere

C#
 using System;
using System.IO;
class program
{
    public static void Main()
    {
        double r, surface_area, volume;
        double PI = 3.14;
        Console.WriteLine("Enter the Radius of the Sphere: ");
        r = Convert.ToDouble(Console.ReadLine());
        surface_area =  4* PI * r * r;
        volume = (4.0 / 3) * PI * r * r * r;
        Console.WriteLine("Surface Area of Sphere is : {0} ", surface_area);
        Console.WriteLine("Volume of Sphere is : {0}", volume);
        Console.Read();
    }
} 

/*
Here is the output of the C# Program: Enter the Radius of Sphere : 5 Surface Area of Sphere is : 314 Volume of Sphere is : 523.333333333333333

*/

Report Bug

Please Login to Report Bug

Reported Bugs

Comments

Please Login to Comment

Comments