Q193
What will be the output of the following C++ code? #include using namespace std; class sample private: int var; public: void input() cout << var; void output() cout << "Variable entered is "; cout << var << " "; ; int main() sample object; object.input(); object.output(); object.var(); return 0;
A.
Enter an integer 5
Variable entered is 5
Variable entered is 5
B.
Runtime error
C.
Error
AnswerD.
Enter an integer 7
Variable entered is 7
Variable entered is 7
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board