Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 ?    91 Yes 40 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why should a c++ programmer be interested in stl?

1032


Who wrote stl?

1080


Is string part of stl?

1155


How do I convert a stl file?

1036


Explain stl.

1307


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

2593


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

2114


What is stl language?

1089


what is template and type convertion

2417


What are the components of stl?

1054


What is stl stack?

1073


What is the use of stl?

1045


What is a list in c++ stl?

1119


What is a standard template library (stl)?

1067


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

1150