1.

What will be the output of following code (all header files and required things are included)? class A { int marks; protected : A(int x) { marks=x; } public : A() { marks=100; } } class B { A a; A b=100; }; main() { A a, b=100; B c; }

A. Program runs fine
B. Program gives runtime error
C. Program gives compile time error
D. Program gives logical error
Answer» D. Program gives logical error


Discussion

No Comment Found