What is the problem,if any in the following code: struct Sample { int a; Sample() { a=0; } }; class Sample2:public Sample { }; struct Sample3:protected Sample2{};

  1. nothing wrong will complie fine.

  2. class cannot inherit from struct

  3. struct cannot inherit from class

  4. struct cannot have constructor


Correct Option: A

Find more quizzes: