wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz C++ Ch. 3 - Variable Names

Total questions: 12

Worksheet time: 4mins

Name
Class
Date
1.

Is this a correct identifier in C++?

Nett Salary

a)

Yes

b)

No

2.

Is this a correct identifier in C++?

Hafiz!!

a)

Yes

b)

No

3.

Is this a correct identifier in C++?

Name_Hafiz

a)

Yes

b)

No

4.

Is this a correct identifier in C++?

Malaysia#

a)

Yes

b)

No

5.

Is this a correct identifier in C++?

Name_Benjamin

a)

Yes

b)

No

6.

Is this a correct identifier in C++?

10thJanuary

a)

Yes

b)

No

7.

Which of the following is NOT a reserved word in C++?

a)

double

b)

return

c)

namespace

d)

name

8.

Which of the following is NOT a legal identifier?

a)

first

b)

payRate

c)

Hello!

d)

Amount

9.

Reserved words cannot be used as identifiers in C++.

a)

true

b)

false

10.
Which statement about identifiers is correct?
a)
Identifiers are not case sensitive.
b)
Spaces are permitted inside identifiers.
c)
Identifiers can be made up of letters, digits, and the underscore (_) character.
d)
Identifiers can use symbols such as ? or %.
11.

Another name for a variable is identifier.

a)

True

b)

False

12.

double is an example of an identifier.

a)

True

b)

False