Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Recap C++

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is the characteristics of C++ programming?

a)

- Modular

- Portable

- Supports procedural and OOP

- Case-Sensitive

- Rich Library

b)

- Modular

- Portable

- Rich Library

c)

- Supports procedural and OOP

- Case-Sensitive

- Rich Library

d)

- Rich Library

e)

None

2.

Which is one is relational operators?

a)

<, >, <=, >=, ==, !=

b)

+, -, *, /, %

c)

=, +=, -=, *=, /=, %=

d)

&&, ||, !

3.

Which is one is assignment operators?

a)

&&, ||, !

b)

+, -, *, /, %

c)

<, >, <=, >=, ==, !=

d)

=, +=, -=, *=, /=, %=

4.

Which are logical operators?

a)

&&

b)

||

c)

!

d)

All of the answers

5.

(3 * 8 – 2 * 5) % (2 - 1) == ?

a)

1

b)

0

c)

14

d)

10

6.

What is the difference between double and float?

a)

The byte size

b)

Same, no difference

c)

Decimals

7.

Which are variable initialization?

a)

A

b)

B

c)

C

d)

None

8.

What header needed when using character testing?

a)

#include <cctype>

b)

#include <iomanip>

c)

#include <cstring>

d)

#include <string>

9.

Which is the output for the program?

a)

b)

c)

10.

Which one is the program output?

a)

4.9188

b)

4.92

c)

4.919

d)

4.91877

11.

Which are the syntax for C-string with white spaces?

a)

getline(cin, variableName);

b)

cin.getline(arrayName, arraySize);

c)

cin >> variableName;

12.

Which program to appends / combines a string to a string?

a)

strcat

b)

strstr

c)

strcmp

d)

strlen

13.

Which function used to get the program output?

a)

strncpy (string1, string2);

b)

strcpy (string1, string2);

c)

strncat (string1, string2);

d)

strcmp (string1, string2);

14.

Which one is repetition control structure?

a)

b)

c)

15.

How many types of selection control structure?

a)

5

b)

4

c)

3

d)

1

16.

Which one is the syntax of if statement?

a)

if (statement)

expression;

b)

if (expression);

c)

if

statement;

d)

if (expression)

statement;

17.

Which one is the syntax of if...else statement?

a)

if (expression)

statement;

else

statement;

b)

if (statement)

statement;

else

expression;

c)

if (expression)

statement;

d)

if (expression)

statement;

else if (expression)

statement;

18.

Which looping statement has 3 counter-controlled elements?

1. Initialization

2. Boolean expression

3. Update

a)

For loop and do...while loop.

b)

For loop and while loop.

c)

For loop only.

d)

While loop and do...while loop.

19.

Which of the following is the answer for the output program?

a)

b)

c)

d)

None of the answers

20.

Does the program output can be executed if there is no break statement in each switch cases?

a)

Can

b)

Cannot