Home » C++ Programming » Classes & Objects » Question
  1. What is the output of the following program?
    #include 
    using namespace std;
    class BoxVolume
    {
    public :
    double L;
    double B;
    double H;
    };
    int main( )
    {
    BoxVolume Box;
    double vol;
    Box.H = 3;
    Box.L = 4;
    Box.B = 2.15;
    vol = Box.H * Box.L * Box.B;
    cout << "Volume of Box : " << vol < return 0;
    }
    1. 3
    2. 4
    3. 2.15
    4. 25.8
    5. None of these
Correct Option: D

In the above program, we are calculating the area of the cube by using the cube formula.



Your comments will be displayed only after manual approval.