Right shifting of a data (number) by 1 is equivalent to data/2. In data, every bit is a power of 2, with each right shift we are reducing the value of each bit by a factor of 2.
#include <stdio.h>
int main()
{
unsigned int data = 16; //value of data
data = data >> 1; // equivalent to data/2
printf("data = %d\n", data);
return 0;
}
Right shifting of a data (number) by 1 is equivalent to data/2. In data, every bit is a power of 2, with each right shift we are reducing 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