main.cs1143 chars28 lines
In this program, we initialize the number of sides of the regular polygon, radius and height of the cone. Then we calculate the circumference of the base of the cone, the length of one side of the polygon and the apothem of the polygon. Using these values, we calculate the area of the base polygon and the volume of the cone. Finally, we print the volume of the polygon inscribed in the cone.
gistlibby LogSnag