Q.

What will be the output of following program?
#include <iostream> using namespace std;
class Test{
public:
Test() { cout <<"Hello from Test() "; }
} a;
int main()
{
cout <<"Main Started "; return 0;
}

A. main started
B. main started hello from test()
C. hello from test() main started
D. compiler error: global objects are not allowed
Answer» C. hello from test() main started
2.4k
0
Do you find this helpful?
21

Discussion

No comments yet

Related MCQs