Sail E0 Webinar
Question


What is the output of the following program?


1.
#include
2.
using namespace std;
3.
class Box
4.
{
5.
public :
6.
double length;
7.
double breadth;
8.
double height;
9.
};
10.
int main( )
11.
{
12.
Box Box1;
13.
double volume;
14.
Box1.height = 5;
15.
Box1.length = 6;
16.
Box1.breadth = 7.1;
17.
volume = Box1.height * Box1.length * Box1.breadth;
18.
cout
Options:
A .  210
B .  213
C .  215
D .  217
Answer: Option B

In the above program, we are calculating the area of the cube by using the cube formula
Output:
$ g++ obj1.cpp
$ a.out
213



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers