write C++ program to find volume of cube using function without arguments
Answers
Answered by
0
Answer:
include<iostream.h>
#include<conio.h>
const float pi=3.14;
float vol(float l) //Cube
{
return l*l*l;
}
float vol(float r,float h) //Cylinder
{
return (pi*r*r*h);
}
float vol(float l,float b,float h)
{
return (l*b*h);
}
void main()
{
float l,r,b,h,t;
clrscr();
cout<<“\nEnter the Length of Cube: \n”;
cin>>l;
t=vol(l);
cout<<“\n\nVolume of Cube: “<<t;
cout<<“\n\nEnter the Radius & Hieght of Cylinder: \n”;
cin>>r>>h;
t=vol(r,h);
cout<<“\n\nVolume of Cylinder: “<<t;
cout<<“\n\nEnter the Length,Breadth & Hieght of Rectangle: \n”;
cin>>l>>b>>h;
t=vol(l,b,h);
cout<<“\n\nVolume of Rectangle: “<<t;
getch();
}
Explanation:
this is the answer
Similar questions
Chemistry,
1 day ago
Math,
1 day ago
Math,
3 days ago
Social Sciences,
3 days ago
English,
8 months ago
Computer Science,
8 months ago