Popular Posts

13.Write a program to find the volume of cube, cylinder and box .

13.Write a program to find the volume of cube, cylinder and box .


#include
#include
int volume(int);
double volume(double,int);
long volume(long ,int,int);
int main()
{
clrscr();
cout<<"1.Volume of cube: "< cout<<"2.Volume of cylinder: "< cout<<"3.Volume of box: "< getch();
return 0;
}
int volume(int s)
{
return (s*s*s);
}
double volume(double r,int h)
{
return (3.1416*r*r*h);
}
long volume(long l,int b,int h)
{
return(l*b*h);
}

Output:

1.Volume of cube: 1000
2.Volume of cylinder: 157.08
3.Volume of box: 112500


No comments: