C++ OOPs Concepts & Inheritance Quiz

C++ OOPs Concepts & Inheritance Quiz

University

20 Qs

quiz-placeholder

Similar activities

Artificial Neural Networks (Part 1- Part 3) Quiz

Artificial Neural Networks (Part 1- Part 3) Quiz

University

20 Qs

CODEBURST : JAVA EDITION

CODEBURST : JAVA EDITION

University

20 Qs

BugBlitz

BugBlitz

University

15 Qs

TECH WHIZ

TECH WHIZ

University

15 Qs

Cipher Quest Round 1&2 Combined Set 1

Cipher Quest Round 1&2 Combined Set 1

University

20 Qs

Code Sprint '25

Code Sprint '25

University

20 Qs

SOFTWARE ENGINEERING QUIZ

SOFTWARE ENGINEERING QUIZ

University

15 Qs

DS QUIZ-1 (CSE-42)

DS QUIZ-1 (CSE-42)

University

16 Qs

C++ OOPs Concepts & Inheritance Quiz

C++ OOPs Concepts & Inheritance Quiz

Assessment

Quiz

Engineering

University

Hard

Created by

Shrutika Nakadi

Used 6+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is not a feature of OOP in C++?

Encapsulation

Abstraction

Inheritance

Compilation

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the default access specifier for members of a class in C++?

Public

Private

Protected

Internal

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What type of inheritance is shown in the following code? class A { }; class B : public A { }; class C : public B { };

Single inheritance

Multiple inheritance

Multilevel inheritance

Hybrid inheritance

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of this code? class Base { public: void show() { cout << "Base class"; } }; class Derived : public Base { public: void show() { cout << "Derived class"; } }; int main() { Derived d; d.show(); return 0; }

Base class

Derived class

Error

Nothing

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which keyword is used to inherit a class in C++?

inherit

extends

using

:

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is not a C++ token?

Identifier

Keyword

Punctuation

Class

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of this code snippet? class A { public: int x = 10; }; class B : public A { public: void display() { cout << x; } }; int main() { B obj; obj.display(); return 0; }

Error

10

0

Garbage value

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?