wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz Topic 3 STM101733 PSPD

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is the output of this program?

Program

int main( )

{

cout<<"Hi everybody";

return 0;

}

a)

"Hi everybody"

b)

Hi everybody"

c)

Hi everybody

d)

"Hi everybody

2.

The process of creating a new variable without value

a)

declaration

b)

naming

c)

instantiation

d)

assigning

3.

If originally x=2,y=0, and z=1, what is the value of x, y, and z after executing the following code?

if (x>y)

y=x;

else

z=x;

a)

x=0 y=2 z=0

b)

x=2 y=1 z=1

c)

x=2 y=2 z=1

d)

x=2 y=0 z=1

4.

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

a)

start( )

b)

system( )

c)

main( )

d)

program( )

5.

What does <= mean?

a)

less than

b)

greater than

c)

less than or equal to

d)

greater than or equal to

6.

A list of instructions that enable a computer to perform a specific task is a...

a)

Computer Program

b)

Algorithm

c)

Algorithm

d)

Algorithm

7.

Evaluate the following expressions to true or false

3!=4-1

a)

true

b)

false

8.

A programmer is:

a)

person who types

b)

person who writes code and communicates instructions to a computer

c)

person who types

d)

person who types

9.

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

a)

>

b)

=

c)

<=

d)

==

10.

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

a)

Integer

b)

Float

c)

Logical

d)

Character

11.

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

a)

&

b)

||

c)

&&

d)

!

12.

Evaluate the following expressions to true or false

5+1==6 || 8-1>4

a)

True

b)

False

13.

Which command moves the shown text to the new line?

a)

\r

b)

\t

c)

\n

d)

\s

14.

After running the following code, what will be the value of x?

y = 3; x = 5 * y;

a)

3

b)

5

c)

15

d)

0

15.

Evaluate the following expressions to true or false

5 >= (1+6)-4

a)

True

b)

False

16.

What punctuation is used to signal the beginning and end of code blocks?

a)

-> and <-

b)

{ }

c)

BEGIN and END

d)

( and )

17.

Which of the following is a CORRECT comment?

a)

*/comments*/

b)

** Comment **

c)

/* Comment */

d)

{ Comment }

18.

... variables store whole numbers (-4, 3, 51, etc).

a)

Float

b)

Logical

c)

Integer

d)

Character

19.

What is the output of this program?

Program

int main( )

{

cout<<"Hello World!!!";

return 0;

}

a)

"Hello World!!!"

b)

Hello World!!

c)

Hello World!!!

d)

Hello World!!!"

20.

What will the result of 'num' variable after execution of the following statements?

int num = 58;

num % = 11;

a)

10

b)

3

c)

5

d)

7