Multiple Choice
What is the output of the following program?
#include <iostream>
Using namespace std;
Class TestClass
{
private:
int val;
void showVal()
{ cout << val << endl; }
public:
TestClass(int x)
{ val = x; }
};
int main()
{
TestClass test(77) ;
test.showVal() ;
return 0;
}
A) the program runs but there is no output.
B) 77
C) 0
D) the program will not compile
Correct Answer:

Verified
Correct Answer:
Verified
Q6: When the body of a member function
Q7: You must declare all data members of
Q8: A class is a(n) _ that is
Q9: When a member function is defined outside
Q10: More than one destructor function may be
Q12: Members of the class object are accessed
Q13: The constructor function's return type is<br>A) int<br>B)
Q14: The constructor function may not accept arguments.
Q15: The type of member function that may
Q16: In-place member initialization no longer is available