I have a confusion in left shift operator. I watched few YouTube videos but now I stuck with two different methods.
45 <<3
- converted into binary =
1 0 1 1 0 1
Shifted by 3 places from left and added 3 new zeros at the right side.
101101 000 = 360
- converted into binary = 1 0 1 1 0 1
Make it 8- bit so 00101101
Discarded three bits from the left side
01101
And add 3 bits to the right side
01101000 = 104
Now which one is correct?
has context menu
Which method is correct out of the above two? and what is the reason?