Can we use bitwise operator, more specifically right shift operator to change “num” after we extract the last bit?
e.g. let num = 101
after extracting the LSB ( 1 ), can we do the following:
num = num >> 1; to change num?
while(num > 0){
a = num%10;
dec_num = dec_num + (a*(2^p));
num = num>>1;
p = p++;
}
can this be done?