Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C++

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

Which of the following is the correct syntax of including a user defined header files in C++?

a)

#include “userdefined”

b)

#include [userdefined]

c)

#include <userdefined>

d)

#include <userdefined.h>

2.

Which of the following is used for comments in C++?

a)

// comment */

b)

// comment

c)

/* comment */

d)

both // comment or /* comment */

3.

Which function is used to write a single character to console in C++?

a)

write(ch)

b)

cout.put(ch)

c)

printf(ch)

d)

cout.putline(ch)

4.

Which of the following is called insertion/put to operator?

a)

>>

b)

<

c)

>

d)

<<

5.

Wrapping data and its related functionality into a single entity is known as _____________

a)

Polymorphism

b)

Abstraction

c)

Encapsulation

d)

Modularity

6.

What does polymorphism in OOPs mean_____________.

a)

Concept of hiding data

b)

Concept of wrapping things into a single unit

c)

Concept of allowing overiding of functions

d)

Concept of keeping things in differnt modules/files

7.

C++ is ______________

a)

procedural programming language

b)

object oriented programming language

c)

functional programming language

d)

both procedural and object oriented programming language

8.

Which of the following is the correct syntax to print the message in C++ language?

a)

cout <<"Hello world!";

b)

Cout << Hello world! ;

c)

Out <<"Hello world!;

d)

Out <<"Hello world!::;

9.

For inserting a new line in C++ program, which one of the following statements can be used?

a)

\a

b)

\r

c)

\a a

d)

\n

10.

Which of the following statement is correct about the C++ programming language?

a)

In C++, member function are allowed to be of the type canst

b)

In C++, Dynamic checking is allowed

c)

In C++, Static checking is allowed

d)

In C++, both the Static and Dynamic type checking are allowed