Here is source code of the C Program to Find the volume and surface area of cone. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
* C Program to Find the volume and surface area of cone
float radius, height;
float surface_area, volume;
printf("Enter value of radius and height of a cone :\n ");
scanf("%f%f", &radius, &height);
surface_area = (22 / 7) * radius * (radius + sqrt(radius * radius + height * height));
volume = (1.0/3) * (22 / 7) * radius * radius * height;
printf("Surface area of cone is: %.3f", surface_area);
printf("\n Volume of cone is : %.3f", volume);
Output: $ cc pgm31.c -lm $ a.out Enter value of radius and height of a cone : 6 9 Surface area of cone is: 302.700 Volume of cone is : 324.000
Sanfoundry Global Education & Learning Series – 1000 C Programs.