What will be the output of the following C++ program? #include <iostream>…

PYQ DSSSB 2022

What will be the output of the following C++ program?

#include <iostream>
using namespace std;
class Wall {
private:
  double length;
public:
  Wall() {
    length = 5.5;
    cout << "Creating a wall." << endl;
    cout << "Length = " << length << endl;
  }
};
int main() {
  Wall wall1;
  return 0;
}
  1. A.

    Creating a wall Length = 5.5

  2. B.

    Creating a wall

  3. C.

    Length = 5.5

  4. D.

    Compile time error

Attempted by 439 students.

Sign up free to check your answer

Sign up free

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…