wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PF selection statement

Total questions: 5

Worksheet time: 3mins

Name
Class
Date
1.

Identify which is NOT the type of selection control structure

a)

if-else

b)

nested if

c)

do while

d)

switch case

2.

choose the syntax for an 'if' statement

a)

if(condition)

b)

if condition

c)

condition if

d)

if {condition}

3.

choose the correct syntax to write condition based on the statement below

"if sum is equal to 32 and total is equal to 2"

a)

if (sum==32) || (total==2)

b)

if (sum==32) && (total==2)

c)

if (sum=32) || (total=2)

d)

if (sum=32) && (total=2)

4.

identify the value of 'y' after the switch statement in figure is executed

a)

0

b)

1

c)

5

d)

4

5.

"if sum is less or equal to 25 and average is equal to 45"

The sentence is the condition statement in a selection control structure. Identify the CORRECT statement to write the condition statement in C++

a)

if (sum <= 25) || (average == 45)

b)

if (sum <= 25) && (average == 45)

c)

if (sum = 25) && (average = 45)

d)

if (sum < 25) || (average = 45)