How to calculate the volume of cone in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        int radius = 12;  
        int height = 25;
        double pi = 3.14159265359;  
      
        double cone_volume = pi * (radius * radius) * height / 3;

        Console.Write("Cone volume = " + cone_volume);
    }
}


 
 
 
/*
run:
  
Cone volume = 3769.911184308
 
*/

 



answered Jul 14, 2021 by avibootz

Related questions

1 answer 128 views
1 answer 132 views
1 answer 125 views
1 answer 336 views
1 answer 216 views
1 answer 318 views
1 answer 126 views
...