ExamVeda
Login
Home
Classes and Objects in C plus plus
?

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class Box
{
    public :
    double length;
    double breadth;
    double height;
};
int main( )
{
    Box Box1;
    double volume;
    Box1.height = 5;
    Box1.length = 6;
    Box1.breadth = 7.1;
    volume = Box1.height * Box1.length * Box1.breadth;
    cout << "Volume of Box1 : " << volume <<endl;
    return 0;
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.