12th Class Computers Science Sample Paper Cyber Olympiad Sample Paper-5

  • question_answer
    What happens when we try to compile the class definition in the following code snippet in C++? class shape {};class square : protected shape {};

    A) It will not compile because class body of shape is not defined.

    B) It will not compile because class body of square is not defined.

    C) It will not compile because a class cannot be protectedly inherited from other class.

    D) It will not compile successfully.

    Correct Answer: D


You need to login to perform this action.
You will be redirected in 3 sec spinner