Solved

What Is the Output of the Following Program?
#Include \quad

Question 22

Multiple Choice

What is the output of the following program?
#include <iostream>
using namespace std;
class TestClass
{
\quad public:
\quad\quad TestClass(int x)
\quad\quad { cout << x << endl; }
\quad\quad TestClass()
\quad\quad { cout << "Hello!" << endl; }
};
int main()
{
\quad TestClass test;
\quad return 0;
}


A) The program runs, but with no output.
B) 0
C) Hello!
D) The program will not compile.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions