wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C++ Basics

Total questions: 25

Worksheet time: 15mins

Name
Class
Date
1.

This is a code that has not yet been linked into a complete program.

a)

Source Code

b)

Assembly Code

c)

Object Code

d)

Machine Code

2.

The language that the central processing unit can understand after it has been translated by the compiler.

a)

Source Code

b)

Assembly Code

c)

Object Code

d)

Machine Code

3.

The object code is produced in what program development phase?

a)

Preprocessing

b)

Compilation

c)

Linking

d)

Loading

e)

Executing

4.

In what phase the c++'s executable program is produced?

a)

Preprocessing

b)

Compilation

c)

Linking

d)

Loading

e)

Executing

5.

What happens first when a C++ executable is run?

a)

The preprocessor converts the source code into an object code.

b)

The compiler converts the object code into an executable code.

c)

The linker links the object code with the missing functions needed to produce the executable code.

d)

The loader places the program in the memory

e)

The CPU executes the program

6.

By default, how are instructions executed by the CPU?

a)

One instruction a a time

b)

Several Instructions at a time

c)

All instructions in one time

d)

None of the above

7.

Single line comments are denoted by what symbol?

a)

//

b)

\\

c)

/*

d)

*/

8.

Which of the following are ignored by the C++ compiler and the computer? Check all that applies.

a)

Comments

b)

Blank lines

c)

Spaces

d)

Tab Spaces

e)

Preprocessing directives

9.

A preprocessing directive starts with what symbol?

a)

//

b)

#

c)

(

d)

{

10.

The library defined in the preprocessor directive must be enclosed by what symbols?

a)

{ }

b)

[ ]

c)

< >

d)

( )

11.

Blanks lines, spaces, and tab characters are called?

a)

Keywords

b)

White spaces

c)

Symbols

d)

Escape Sequences

12.

A code that is reserved by C++ for a specific use.

a)

Keyword

b)

White space

c)

Symbol

d)

Escape Sequence

13.

Which symbol starts a block of code?

a)

<

b)

(

c)

{

d)

[

14.

Which symbol is used to determine that a code/keyword is a function?

a)

<

b)

(

c)

{

d)

[

15.

The words enclosed in double quotation marks are known as the following EXCEPT what?

a)

String

b)

Character String

c)

String Literal

d)

Stream

16.

The semicolon (;) is used to?

a)

Start a block of code

b)

Terminate a function

c)

Start a statement

d)

End a statement

17.

Which of the following is the scope resolution operator?

a)

<<

b)

>>

c)

::

d)

\

18.

Which of the following is the escape character operator?

a)

<<

b)

>>

c)

::

d)

\

19.

Which of the following is the stream insertion operator?

a)

<<

b)

>>

c)

::

d)

\

20.

Which of the following is the stream extraction operator?

a)

<<

b)

>>

c)

::

d)

\

21.

A location in the computer's memory where a value can be stored for use by a program. Note: Answer must be in UPPERCASE letters.

(a)  

22.

Which of the following is the input stream object?

a)

>>

b)

<<

c)

cin

d)

cout

23.

Which of the following is NOT a VALID identifier?

a)

X1

b)

_X1

c)

x1

d)

_1x

e)

1x

24.

Which of the following are VALID identifiers?

a)

int

b)

include

c)

return

d)

zero

25.

All variables must be declared before they are used.

a)

True

b)

False