Answers

Question and Answer:

  Home  Standard Template Library (STL)

⟩ Write a c++ to define a class box with length, breadth and height as data member and input value(), printvalue() and volume() as member functions?

#include<iostream.h>

#include<conio.h>

class BOX

{

private:

int l,b,h;

public:

void input();

void print();

long volume(long,int,int);

};

void BOX::input()

{

cout<<"input values of l,b,&h"<<"n";

cin>>l>>b>>h;

}

void BOX::print()

{

cout<<"volume="<<"n";

}

void BOX::volume()

{

long volume(long l,int b,int h);

{

return(l*b*h);

}

}

void main()

{

set BOX b1;

b1.input();

b1.print();

b1.volume();

return;

}

 201 views

More Questions for you: