C : Program for making calculator for cuboid
Oct 20, 2023
Program :
//c program for making calculator for cuboid
#include<stdio.h>
float area_verticle_surfaces_cuboid(float l, float w, float h)
{
return 2*(l+w)*h;
}
float total_surface_area_cuboid(float l, float w, float h)
{
return 2*(l*w + w*h + l*h);
}
float volume_cuboid(float l, float w, float h)
{
return l*w*h;
}
int main()
{
float length,width,height;
printf("Cuboid Calculator\n\n");
printf("Enter lenght of cuboid :");
scanf("%f", &length);
printf("Enter width of cuboid :");
scanf("%f", &width);
printf("Enter height of cuboid :");
scanf("%f", &height);
printf("\nThe area of verticle surfaces of cuboid : %.3f sq.cm", area_verticle_surfaces_cuboid(length, width, height));
printf("\nTotal surface area of cuboid : %.3f sq.cm", total_surface_area_cuboid(length, width, height));
printf("\nThe area of verticle surface of cuboid : %.3f sq.cm", volume_cuboid(length, width, height));
return 0;
}
Output :