Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

LOOPS in OOPS

Total questions: 20

Worksheet time: 7mins

Name
Class
Date
1.

A C++ program is made up of one or more (a)   ?


2.

Which section in a class definition is used for declaring is used for declaring the functions but not defining them?

a)


Private section

b)

Public section

c)

Member section

d)

Function section

3.

In C++, you can use the (a)   keyword to create instances of a class.


4.

In C++,what is a class?

a)

A reserved keyword

b)

A user-defined data type

c)

A constant value

d)

A storage class

5.

User-defined data types are created by the (a)   .


6.

Which of the following is NOT a component of a C++?

a)

Source file

b)

Header file

c)

Namespace

d)

Compiler

7.

(a)   is the concept of bundling data(attributes) and methods(functions) that operate on that data into a single unit.

8.

Which of the following is NOT a basic concept of OOPS?


a)

Inheritance

b)

Loops

c)

Encapsulation

d)

Polymorphism

9.

Objects of a class can also be returned from (a)   .


10.

Which of the following represent fixed values that do not change during the execution of a program?

a)

Identifiers

b)

Constants

c)

Keywords

d)

Basic data types

11.

The (a)   Control structure is used for multi-way decision-making in C++.

12.

What control structure in C++ is used for handling multiple conditions in a structured manner?

a)

if...else

b)

for

c)

break

d)

while

13.

An array of objects in C++ allow you to create multiple (a)   objects.


14.

Which control structure is used to replace is used to replace multiple "if" statements for multi-way decision-making?

a)

if...Else

b)

while

c)

for

d)

switch

15.

The (a)   statement is used to exit a loop prematurely.

16.

Which control structure is used when you want to execute a block of code repeatedly as long as a condition is true?

a)

if

b)

while

c)

switch

d)

for

17.

Keywords, identifiers, constants, and basic data types are examples of C++?




(a)  

18.

What is the purpose of "private" member functions in a class?

a)

They are accessible from external code.

b)

They are only accessible within the class itself.

c)

They can be overridden in derived classes.

d)

They are used to declare global functions.

19.

Dynamic initialization of variables occurs at (a)   during program execution.

20.

What does specifying a class in C++ involve?


a)

Defining the attributes and functions of the class.

b)

Including the <iostream.h> header file.

c)


Declaring variables in the global scope.

d)

Writing the program's main function.