/*
* 1000+ C programs + tutorials
*
*
* 14_calculate_volume_of_sphere.c
*
*
* Created on: Oct 20, 2014
* Author: Code2care.org
*/
#include <stdio.h>
//#include <conio.h>
void main() {
int radius;
float volume_of_sphere;
float PI = 3.142;
// clrscr();
printf(" Program to calculate Volume of a Sphere : ");
printf("\n\n Enter the Radius of Sphere : ");
scanf("%d", &radius);
volume_of_sphere = (4/3)*(PI*radius*radius*radius);
printf("\n\n Volume of Sphere with Radius as %d = %f",radius,volume_of_sphere);
// getch();
}
-
Output :
Program to calculate Volume of a Sphere :
Enter the Radius of Sphere : 2
Volume of Sphere with Radius as 2 = 25.136000
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.