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 / manish bhambhu

#include<iostream>
using namespace std;
class cuboid
{
public:
float length;
float breadth;
float height;
};
int main()
{
cuboid Box1;
cuboid Box2;
float volume = 0.0;
Box1.height = 5.0;
Box1.length = 6.0;
Box1.breadth = 7.0;
Box2.height = 10.0;
Box2.length = 12.0;
Box2.breadth = 13.0;
volume=Box1.height*Box1.length*Box1.breadth;
cout<<"
Volume of Box1 : "<<volume<<endl;
volume=Box2.height*Box2.length*Box2.breadth;
cout<<"
Volume of Box2 : "<<volume<<endl;
return 0;
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is string part of stl?

1157


How does an stl file work?

1102


What are the various types of stl containers?

1116


How is stl different from c++ standard library?

1261


how to use C++?

2491


What does stl stand for in basketball?

1088


What is stl stand for?

1170


Name the different types of stl containers.

1125


What do stl stand for?

1076


write a program that will accept a number and print.its equivalent in words the maximum input number is 9999

2976


What is the stl, standard template library?

1050


What is a standard template library (stl)?

1074


sir please send me bpcl previous question papers

2341


What is stl language?

1097


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

2597