#include<stdio.h>
#include<conio.h>
#include<math.h>
#define a 1.3
#define pi 3.14
#define c 1/3
void main()
{
float r,h,l,b,result,result2,result3,result4;
char wish;
clrscr();
printf("\nR: Cube");
printf("\nS: sphere");
printf("\nC: cuboid");
printf("\nO: cone");
printf("\nH: cylinder");
printf("\nY: hemisphere");
printf("\nchoice: ");
wish=getchar();
switch(wish)
{
case'r':
case'R':printf("\nEnter the value of length: ");
scanf("%f",&l);
result=l*l*l;
printf("\nvolume of cube is %f unit3",result);
result=6*l*l;
printf("\nT.S.A of cube is %f unit2",result);
result=4*l*l;
printf("\nL.S.A of cube is %f unit2",result);
result=5*l*l;
printf("\nthe surface area of open cube is %f unit2",result);
break;
case'S':
case's':printf("\nEnter the value of radius: ");
scanf("%f",&r);
result=4*3.14*r*r;
printf("\nT.S.A of sphere is %f unit2",result);
result=1.33*3.14*r*r*r;
printf("\n the volume of sphere is %f unit3",result);
break;
case'C':
case'c':printf("\nenter the value of length: ");
scanf("%f",&l);
printf("\nenter the value of breadth: ");
scanf("%f",&b);
printf("\nenter the value of height: ");
scanf("%f",&h);
result=l*b*h;
printf("\nthe volume of cuboid is %f unit3",result);
result=2*l*2*b+2*b*2*h+2*h*2*l;
result2=result/2;
printf("\nT.S.A of cuboid is %f unit2",result2);
result=2*h;
result2=l+b;
result3=result*result2;
printf("\nC.S.A of cuboid is %f unit2",result3);
break;
case'O':
case'o':printf("\nenter the value of height: ");
scanf("%f",&h);
printf("\nenter the value of length: ");
scanf("%f",&l);
printf("\nenter the value of radius: ");
scanf("%f",&r);
result=pi*r*l;
printf("\nthe L.S.A of cone is %f",result);
result=pi*r;
result2=l+r;
result3=result*result2;
printf("\nthe T.S.A of cone is %f unit2",result3);
result=0.33*pi*r*r*h;
printf("\nthe volume of cone is %f unit3",result);
break;
case'Y':
case'y':printf("\nenter the value of radius");
scanf("%f",&r);
result=2*pi*r*r;
printf("\nthe C.S.A of hemisphere is %f unit2",result);
result=3*pi*r*r;
printf("\nthe T.S.A of hemisphere is %f unit2",result);
result=0.66*pi*r*r*r;
printf("\nthe volume of hemisphere is %f unit3",result);
break;
case'H':
case'h':printf("\nenter the value of height");
scanf("%f",&h);
printf("\nenter the value of radius");
scanf("%f",&r);
result=pi*r*r*h;
printf("\nthe volume of cylinder is %f unit3",result);
result=2*pi*r*h;
printf("\nthe C.S.A of ctlinder is %f unit2",result);
result=3*pi*r*h;
printf("\nthe T.S.A of cylinder is %f unit2",result);
break;
}
printf("\npress any key to close program");
getch();
}
/*by sojitra adarsh*/
#include<conio.h>
#include<math.h>
#define a 1.3
#define pi 3.14
#define c 1/3
void main()
{
float r,h,l,b,result,result2,result3,result4;
char wish;
clrscr();
printf("\nR: Cube");
printf("\nS: sphere");
printf("\nC: cuboid");
printf("\nO: cone");
printf("\nH: cylinder");
printf("\nY: hemisphere");
printf("\nchoice: ");
wish=getchar();
switch(wish)
{
case'r':
case'R':printf("\nEnter the value of length: ");
scanf("%f",&l);
result=l*l*l;
printf("\nvolume of cube is %f unit3",result);
result=6*l*l;
printf("\nT.S.A of cube is %f unit2",result);
result=4*l*l;
printf("\nL.S.A of cube is %f unit2",result);
result=5*l*l;
printf("\nthe surface area of open cube is %f unit2",result);
break;
case'S':
case's':printf("\nEnter the value of radius: ");
scanf("%f",&r);
result=4*3.14*r*r;
printf("\nT.S.A of sphere is %f unit2",result);
result=1.33*3.14*r*r*r;
printf("\n the volume of sphere is %f unit3",result);
break;
case'C':
case'c':printf("\nenter the value of length: ");
scanf("%f",&l);
printf("\nenter the value of breadth: ");
scanf("%f",&b);
printf("\nenter the value of height: ");
scanf("%f",&h);
result=l*b*h;
printf("\nthe volume of cuboid is %f unit3",result);
result=2*l*2*b+2*b*2*h+2*h*2*l;
result2=result/2;
printf("\nT.S.A of cuboid is %f unit2",result2);
result=2*h;
result2=l+b;
result3=result*result2;
printf("\nC.S.A of cuboid is %f unit2",result3);
break;
case'O':
case'o':printf("\nenter the value of height: ");
scanf("%f",&h);
printf("\nenter the value of length: ");
scanf("%f",&l);
printf("\nenter the value of radius: ");
scanf("%f",&r);
result=pi*r*l;
printf("\nthe L.S.A of cone is %f",result);
result=pi*r;
result2=l+r;
result3=result*result2;
printf("\nthe T.S.A of cone is %f unit2",result3);
result=0.33*pi*r*r*h;
printf("\nthe volume of cone is %f unit3",result);
break;
case'Y':
case'y':printf("\nenter the value of radius");
scanf("%f",&r);
result=2*pi*r*r;
printf("\nthe C.S.A of hemisphere is %f unit2",result);
result=3*pi*r*r;
printf("\nthe T.S.A of hemisphere is %f unit2",result);
result=0.66*pi*r*r*r;
printf("\nthe volume of hemisphere is %f unit3",result);
break;
case'H':
case'h':printf("\nenter the value of height");
scanf("%f",&h);
printf("\nenter the value of radius");
scanf("%f",&r);
result=pi*r*r*h;
printf("\nthe volume of cylinder is %f unit3",result);
result=2*pi*r*h;
printf("\nthe C.S.A of ctlinder is %f unit2",result);
result=3*pi*r*h;
printf("\nthe T.S.A of cylinder is %f unit2",result);
break;
}
printf("\npress any key to close program");
getch();
}
/*by sojitra adarsh*/