/*
* 1000+ C programs + tutorials
*
*
* 12_calculate_volume_of_cone.c
*
*
* Created on: Oct 20, 2014
* Author: Code2care.org
*/
#include <stdio.h>
//#include <conio.h>
void main() {
int height;
int radius;
float volume_of_cone;
float PI = 3.142;
// clrscr();
printf(" Program to calculate Volume of a Cone : ");
printf("\n\n Enter the Radius of Cone : ");
scanf("%d", &radius);
printf("\n\n Enter the Height of Cone : ");
scanf("%d", &height);
volume_of_cone = PI*radius*radius*height;
printf("\n\n Volume of Cone with Radius as %d and Height as %d = %f",radius,height,volume_of_cone);
// getch();
}
-
Output :
Program to calculate Volume of a Cone :
Enter the Radius of Cone : 2
Enter the Height of Cone : 5
Volume of Cone with Radius as 2 and Height as 5 = 62.840000
The best way to learn C programming is to practice more and more of programs .
Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.
BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.