Computer Science, asked by amiramesh12, 3 days ago

write C++ program to find volume of cube using function without arguments​

Answers

Answered by mpv12pk024
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