Q
If x = 10 and y = 2, what is the output of x >> y?

Answer & Solution

Answer: Option A
Solution:
The bitwise right shift operator (>>) shifts the bits of the first operand to the right by the number of positions specified by the second operand. 10 >> 2 results in binary 2, which is 2 in decimal.
Related Questions on Average

If x = 5 and y = 3, what is the output of x << y?

A). 10

B). 40

C). 20

D). 8

What is the output of 11 & 8?

A). 0

B). 1

C). 8

D). 11

What does ~15 evaluate to?

A). 15

B). -15

C). -16

D). 16

What does ~11 evaluate to?

A). 11

B). -10

C). -11

D). 10

What is the output of 12 | 8?

A). 12

B). 8

C). 4

D). 0

What is the output of 15 ^ 9?

A). 6

B). 8

C). 9

D). 24

Given x = 9 and y = 4, what is the value of x >>> y?

A). 1

B). 0

C). 2

D). 4

What will be the result of 5 & 3?

A). 4

B). 1

C). 7

D). 8

What is the result of 7 | 5?

A). 3

B). 6

C). 5

D). 7

What will be the result of 20 & 14?

A). 4

B). 8

C). 12

D). 20