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