wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz C++

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

What is the only function all C++ programs must contain?

a)

system()

b)

main()

c)

start()

d)

program()

2.

Which of the following is a correct comment?

a)

** Comment **

b)

/* Comment */

c)

*/ Comments */

d)

{ Comment }

3.

The process of creating a new variable without value

a)

instantiation

b)

assigning

c)

naming

d)

declaration

4.

Which command moves the shown text to the next line?

a)

\t

b)

\r

c)

\n

d)

\s

5.

After running the following code, determine the value of each of the following arithmetic expressions :


x=10, y =7, z=2;

x + 2 * y – z;

a)

82

b)

14

c)

22

d)

12

6.

Evaluate the following expressions to true or false

!((-4.2<3.0) && (10<20))

a)

True

b)

False

7.

Which of the following is NOT a comparison operator in C++ language?

a)

<=

b)

=

c)

==

d)

>=

8.

... point variables store decimal numbers (3.5, -5,123, 4.0, etc).

a)

string

b)

float

c)

integer

d)

character

9.

What is the output of this program?

int main()

{

cout<<"I\t LOVE \n\tPROGRAMMING";

return 0;

}

a)
b)
c)
d)
10.

Identify whether these identifiers are valid or invalid.


No_student[3]

a)

Valid

b)

Invalid