Popular Posts

37.Create a class box whose function is passed three double value each of which represents the length of one single of the box compute the volume of the box.

37.Create a class box whose function is passed three double value each of which represents the length of one single of the box compute the volume of the box.

#include
#include
class box
{
double l,w,h,v;
public:
box(double length,double width,double height)
{l=length ;w=width; h=height;}
void volume(void);
};
void box::volume(void)
{
v=l*w*h;
cout<<"Volume of the box: "< }
int main()
{
clrscr();
box b(3.0,2.5,3.5);x
b.volume();
getch();
return 0;
}

Output:

Volume of the box: 26.25

No comments: