9.Write a program in C to perform bitwise left shift on a number using the '<<' operator.
Bitwise Left shift Operator (<<):
The bitwise left shift operator (<<) is a binary operation that shifts the bits of the left operand according to a specified number of positions in the right operand. The leftmost bits are ignored and the rightmost bits are filled with zeros.
The syntax for the bitwise left shift operator is as follows:
operand1 << operand2
Here,
The symbol << is the bitwise left shift operator in C.
Operand1 is the left operand, i.e. the value to shift, and operand2 is the right operand, which gives the number of positions to shift the bits of the left operand.
In C Languagee the bitwise Left shift operator is represented by the symbol << .
Let us study the bitwise Left shift << operation on the integer number 5 .
5 = 0101 ( Binary)
Bitwise Left shift << Operation on 5
a=5
ans=a<<2
a<<2
010100
________
010100 = 20 (In decimal)