Vidyalelo
C++ Programming · Q62

Object Oriented Programming in C++

Programming · C++ Programming · question 62

Q62

What will be the output of the following C++ code? #include using namespace std; class A int a; A() a = 5; ; int main() A *obj = new A; cout a;

A.
5
B.
Garbage value
C.
Compile-time error
Answer
D.
Run-time error

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board