#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:
Post a Comment