C++ OOPs Concepts & Inheritance Quiz

C++ OOPs Concepts & Inheritance Quiz

University

20 Qs

quiz-placeholder

Similar activities

Nuestra Magia Educativa: Tu aventura comienza

Nuestra Magia Educativa: Tu aventura comienza

University

15 Qs

Parcial Contaminación atmosférica

Parcial Contaminación atmosférica

University

15 Qs

WEEK11-12 Flyback,PF, Half-Bridge

WEEK11-12 Flyback,PF, Half-Bridge

University

17 Qs

Antecedentes Conocimiento Mecánica Orbital

Antecedentes Conocimiento Mecánica Orbital

University

15 Qs

DLD Unit 1 _ 2

DLD Unit 1 _ 2

University

20 Qs

EXAMEN 2DO PARCIAL 01_03

EXAMEN 2DO PARCIAL 01_03

University

20 Qs

Diodos y semiconductores

Diodos y semiconductores

University

20 Qs

English for Engineering Part 2

English for Engineering Part 2

University

15 Qs

C++ OOPs Concepts & Inheritance Quiz

C++ OOPs Concepts & Inheritance Quiz

Assessment

Quiz

Engineering

University

Practice Problem

Hard

Created by

Shrutika Nakadi

Used 6+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?