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
πŸ’¬ Discuss
βœ… Correct Answer: (C) hello from test() main started

You must be Logged in to update hint/solution

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
547
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
89%
Success Rate