Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Bitwise Operators in C Language

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the result of 5 & 3 in binary?

a)

2

b)

0

c)

1

d)

4

2.

What is the result of 7 | 2 in binary?

a)

5

b)

7

c)

9

d)

3

3.

What is the result of 10 ^ 6 in binary?

a)

1000000

b)

1111000

c)

1010101

d)

1100110

4.

What is the result of 8 << 2 in binary?

a)

100000

b)

101010

c)

111111

d)

110000

5.

What is the result of 16 >> 3 in binary?

a)

00100

b)

00001

c)

00011

d)

00010

6.

Fill in the blank: Bitwise AND operator returns 1 if ________ bits are 1.

a)

none

b)

either

c)

both

d)

neither

7.

Fill in the blank: Bitwise OR operator returns 1 if ________ bits are 1.

a)

either

b)

none

c)

both

d)

neither

8.

Fill in the blank: Bitwise XOR operator returns 1 if ________ bits are different.

a)

corresponding

b)

opposite

c)

matching

d)

similar

9.

Fill in the blank: Bitwise left shift operator shifts the bits to the ________.

a)

down

b)

left

c)

right

d)

up

10.

Fill in the blank: Bitwise right shift operator shifts the bits to the ________.

a)

down

b)

up

c)

right

d)

left