0% found this document useful (0 votes)
25 views4 pages

Area and Volume of Regular Bodies... U

The document contains code to calculate the areas and volumes of various geometric shapes like cones, cylinders, spheres, cubes, cuboids, pyramids and trapezoids. It prompts the user to input values like radius, side length, height etc and then calculates and prints the area and volume formulas for each shape using the given parameters.

Uploaded by

Tejas Wankhade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

Area and Volume of Regular Bodies... U

The document contains code to calculate the areas and volumes of various geometric shapes like cones, cylinders, spheres, cubes, cuboids, pyramids and trapezoids. It prompts the user to input values like radius, side length, height etc and then calculates and prints the area and volume formulas for each shape using the given parameters.

Uploaded by

Tejas Wankhade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

/*Area and volume of regular bodies*/

#include<stdio.h>

#include<stdio.h>

#define PI 3.14

main()

printf("output");

float r,s,h,a,l,w,b,x,y,area,volume;

printf("Enter the value of the radius:");

scanf("%f",&r);

printf("Enter thr value of the side:");

scanf("%f",&s);

printf("Enter the value of the height:");

scanf("%f",&h);

printf("Enter the value of the a:");

scanf("%f",&a);

printf("Enter the value of the breadth:");

scanf("%f",&b);

printf("Enter the value of the length:");

scanf("%f",&l);

printf("Enter the value of the width:");

scanf("%f",&w);

printf("Enter the value of the x:");

scanf("%f",&x);

printf("Enter the value of the y:");


scanf("%f",&y);

area=(22*r*r)/7+(22*r*s)/7;

printf("Area of the cone=%f",area);

volume=(22*r*r*h)/(3*7);

printf("Volume of the cone=%f",volume);

area=(2*22*r*h)/7;

printf("Area of the cylinder=%f",area);

volume=(22*r*r*h)/7;

printf("Volume of the cylinder=%f",volume);

area=(4*22*r*r)/7;

printf("Area of the sphere=%f",area);

volume=(4*22*r*r*r)/(7*3);

printf("Volume of the sphere=%f",volume);

area=6*a*a;

printf("Area of the cube=%f",area);

volume=a*a*a;

printf("Volume of the cube=%f",volume);

area=2*(l*w+w*h+h*l);

printf("Area of the cuboid=%f",area);

volume=(l*b*h);

printf("Volume of the cuboid=%f",volume);

area=2*b*s+(b*b);

printf("Area of the pyramid=%f",area);

volume=(l*w*h)/3;

printf("Volume of the pyramid=%f",volume);


area=0.5*(x+y)*h;

printf("Area of the trapazoid=%f",area);

volume=0.5*(x+y)*h*l;

printf("Volume of the trapazoid=%f",volume);

}
outputEnter the value of the radius:5

Enter thr value of the side:25

Enter the value of the height:2

Enter the value of the a:45

Enter the value of the breadth:12

Enter the value of the length:1

Enter the value of the width:1

Enter the value of the x:4

Enter the value of the y:9

Area of the cone=471.428589Volume of the cone=52.380951Area of the cylinder=62.8

57143Volume of the cylinder=157.142853Area of the sphere=314.285706Volume of the

sphere=523.809509Area of the cube=12150.000000Volume of the cube=91125.000000Ar

ea of the cuboid=10.000000Volume of the cuboid=24.000000Area of the pyramid=744.

000000Volume of the pyramid=0.666667Area of the trapazoid=13.000000Volume of the

trapazoid=13.000000

--------------------------------

Process exited after 11.53 seconds with return value 0

Press any key to continue . . .

You might also like