Solved

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

Question 11

Multiple Choice

What is the output of the following program?
#include <iostream>
Using namespace std;
Class TestClass
{
private:
\quad int val;
\quad void showVal()
\quad { cout << val << endl; }
public:
\quad TestClass(int x)
\quad { val = x; }
};
int main()
{
\quad TestClass test(77) ;
\quad test.showVal() ;
\quad return 0;
}


A) the program runs but there is no output.
B) 77
C) 0
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