wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Bug Off Test-1 (Set 2)

Total questions: 2

Worksheet time: 15mins

Name
Class
Date
1.

Write answers this way:

1-Answer 2-answer 3-answer (a)  

All answers would be in small case

If one number has two answers then write like this:

1-answer1,answer2

2.

John forgot his debit card pin so he called the bank executive. To maintain the privacy of the account the executive told him a way to get his pin back. The executive gave John a code x=1010 and told him that he will get his pin back after decoding the question. He wants your help because he doesn't have knowledge about logical operations. Which of the following options results in the value of the last 1-bit?

For eg: x = 1100

Here the value of the last 1 from left is 2^2 = 4. So option giving value = 4 will be the answer.

______________________________

^: bitwise XOR operator

| : bitwise OR operator

&: bitwise AND operator

_____________________________

a)

x ^ (x & (x - 1))

b)

x ^ (x | (x + 1))

c)

x ^ (x | (x - 1))

d)

x ^ (x & (x + 1))