Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Tekie-LogicalOperators

Total questions: 21

Worksheet time: 16mins

Name
Class
Date
1.

What will be the output of the following code?

a)

False

b)

True

c)

None of the above

2.

Can you guess the output of the following code correctly?

a)

False

b)

True

c)

None of the above

3.

What is the output of the following code ?

a)

None of the above

b)

False

c)

True

4.

What output will the following output generate?

a)

None of the above

b)

False

c)

True

5.

Rani wrote this code.Now she is wondering what will be the output?Can you help her ?

a)

False

b)

True

c)

None of the Above

6.

Which operator returns True as an output if One or More Expressions are True?

a)

And operator

b)

Or operator

c)

Not operator

d)

Of operator

7.

 Which amongst the following is True about And operator?

a)

And operator returns True only if all the conditions are True.

b)

And operator returns False if all the conditions are True

c)

And operator returns True if any one of the condition is True

d)

And operator returns True only if none of the conditions are True.

8.

 Predict the output of the following code:?

a)

True

b)

False

c)

5<6 and 3>=4

d)

None of the above

9.

Which amongst the following blocks will return true only if all the Expressions are True?

a)
b)
c)
d)
10.

What should be in the blank to make the output as true?

a)

False

b)

True

c)

None of the above

11.

Which operator will evaluate to True if both sides are True and False otherwise?

a)

and

b)

or

c)

not

d)

in

12.

Which operator will evaluate to True if either side is True and False otherwise?

a)

and

b)

or

c)

not

d)

in

13.

Which operator will negate the value of the Boolean expression after it?

a)

and

b)

or

c)

not

d)

in

14.

If the "num" variable has value 5, is this expression True or False?


num < 0 and num > 10

a)

True

b)

False

15.

If the "num" variable has value 0, is this expression True or False?


num < 0 and num > 10

a)

True

b)

False

16.

If the "num" variable has value 5, is this expression True or False?


num > 0 and num < 10

a)

True

b)

False

17.

If the "num" variable has value 0, is this expression True or False?


num > 0 and num < 10

a)

True

b)

False

18.

If the "num" variable has value 0, is this expression True or False?


num > 0 or num < 10

a)

True

b)

False

19.

If the "num" variable has value 5, is this expression True or False?


num > 0 or num < 10

a)

True

b)

False

20.

If the "num" variable has value 5, is this expression True or False?


num < 0 or num > 10

a)

True

b)

False

21.

If the "num" variable has value 0, is this expression True or False?


num < 0 or num > 10

a)

True

b)

False