This C# Program Calculates Area and Volume of a Cone. Here radius and height of the cone is obtained from the user and the surface area and its volume its calculated.

Here is source code of the C# Program to Calculate Area and Volume of a Cone. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.

`/*`

`* C# Program to Calculate Area and Volume of a Cone`

`*/`

using System;

using System.IO;

`class program`

`{`

public static void Main()

`{`

double r, h, surface_area, volume;

double PI = 3.14;

Console.WriteLine("Enter the Radius and Height of a cone : ");

r = Convert.ToDouble(Console.ReadLine());

h = Convert.ToDouble(Console.ReadLine());

surface_area = PI * r * (r + Math.Sqrt(r * r + h * h));

volume = (1.0 / 3) * PI * r * r * h;

Console.WriteLine("Surface Area of cone is : {0} ", surface_area);

Console.WriteLine("Volume of Cone is : {0}", volume);

Console.Read();

`}`

`}`

Here is the output of the C# Program:

advertisement

Enter the Radius and Height of a cone : 3 3 Surface Area of cone is : 68.2256752726637 Volume of Cone is : 28.26

**Sanfoundry Global Education & Learning Series – 1000 C# Programs.**

advertisement

If you wish to look at all C# Programming examples, go to 1000 C# Programs.