Left shifting of a data (number) by 1 is equivalent to data*2. In data, every bit is a power of 2, with each shift we are increasing the value of each bit by a factor of 2.
#include <stdio.h>
int main()
{
unsigned int data = 15; //value of data
data = data << 1; // equivalent to data * 2
printf("data = %d\n", data);
return 0;
}
Left shifting of a data (number) by 1 is equivalent to data*2. In data, every bit is a power of 2, with each shift we are increasing the value of each bit by a factor of 2.
need an explanation for this answer? contact us directly to get an explanation for this answer