Q. Predict the output?
#include <iostream>
using namespace std;
class Test
{
int x;
Test()
{
x = 5;
} };
int main()
{
Test *t = new Test;
cout << t->x;
}

  • (A) Compiler Error
  • (B) 5
  • (C) Garbage Value
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (A) Compiler Error

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
155
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Priyanka Tomar
Publisher
πŸ“ˆ
86%
Success Rate