This program is to find volume of a cube which is based on C Program. This project is basics of C.
This C Program computes the volume of a cube. The formula used to find the volume of the cube is volume = h * l * b.
Here is source code of the C program to compute the volume of a cube. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
[message_box title=”Program ” color=”red”]
/* Write a program to find volume of a cube */
/* Written by Utpal Chaudhary */
/*Studen of L.D COLEGE OF ENGINEERING,Navrangpura,Ahmedabad-15 */
#include <stdio.h>
#include <conio.h>
void main()
{
int h,l,b,v; Â Â Â Â Â /* I take h, l, b, v integer but if you want to take that float,long integer,long float,double etc. Then take it */
clrscr ();
printf (“Enter height:”);
scanf (“%d”,&h);
printf(“Enter lenght:”);
scanf (“%d”, Â &l);
printf(“Enter breadth:”);
scanf (“%d” , &b);
v = l * h * b ;
printf (“Volume of cube:%d”,v);
getch ();
}
[/message_box]
[message_box title=”Output” color=”red”]
Enter height:Â 4
Enter lenght: 4
Enter breadth: 4
Volume of cube:64
[/message_box]