C++ OOPs Concepts & Inheritance Quiz

C++ OOPs Concepts & Inheritance Quiz

University

20 Qs

quiz-placeholder

Similar activities

CC SBL

CC SBL

University

15 Qs

Code Sprint '25

Code Sprint '25

University

20 Qs

General Knowledge Quiz

General Knowledge Quiz

University

20 Qs

Code Blitz 40

Code Blitz 40

University

15 Qs

Java MCQ Test Day-2

Java MCQ Test Day-2

University

20 Qs

TRICODE CHALLENGE ROUND 1

TRICODE CHALLENGE ROUND 1

University

15 Qs

TECH WHIZ

TECH WHIZ

University

15 Qs

2.3.4 - NSPE Code of Ethics

2.3.4 - NSPE Code of Ethics

10th Grade - University

15 Qs

C++ OOPs Concepts & Inheritance Quiz

C++ OOPs Concepts & Inheritance Quiz

Assessment

Quiz

Engineering

University

Medium

Created by

Shrutika Nakadi

Used 2+ 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?