10.Implement a program in C to perform bitwise right shift on a number using the '>>' operator.
Bitwise Right shift Operator (>>):
The binary bitwise right shift operator (>>) shifts the bits of the left operand to the right by the number of positions represented by the right operand. The sign bit, which is the most significant bit of the left operand, is filled into the leftmost bits, leaving the rightmost bit empty.
The syntax for the bitwise right shift operator is as follows:
operand1 >> operand2
The left operand, operand 1, represents the value to be shifted and the right operand, operand 2, represents the number of bits by which the bits must be shifted.
In C Languagee the bitwise Right shift operator is represented by the symbol >> .
Let us study the bitwise Right shift >> operation on the integer number 10 .
10 = 1010 ( Binary)
Bitwise Right shift >> Operation on 10
a=10 --> 1010
ans=a>>2
ans= 0010
________
0010 = 2 (In decimal)