Sir can you pls tell why we use p<<1 i.e. left shift as p is move towards right side.
Regarding p<<1 why p is left shifted
@Hk199977,
hello harsh,
p=p<<1 means p=p*2 .
let consider a binary number 1011 now we want to convert it to decimal .
how will do that we go to each position if that position bit is set then we add 2^(position-1).
bhaiya is calculating 2^(position-1) using p
for position equal 1 p is equal to 1
for position equal 2 p is equal to 2
for position equal 3 p is equal to 4
for position equal 4 p is equal to 8
so on
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.