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.

Answer Posted / muhammad waqas

#include<iostream>
using namespace std;
class Box{
public:
int height;
int length;
int width;
};

main()
{
int height;
int length;
int width;

int volume=0;
Box box1;
Box box2;
box1.height=3;
box1.length=2;
box1.width=1;
volume=box1.height*box1.length*box1.width;

cout<<volume;



}

Is This Answer Correct ?    88 Yes 40 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to use C++?

2059


Who wrote stl?

670


Is stl open source?

623


What does stl mean in slang?

645


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher

1692






What are stl algorithms?

613


how can u do connectivity in c++ language? plz send me connectivity code in c++ ?

1882


What is meant by stl in c++?

646


Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.

1639


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1965


Name the different types of stl containers.

685


Is string part of stl?

668


What is stl stack?

655


How stl is different from the c++ standard library?

633


What does stl stand for in basketball?

632