Suppose, 123 is represented as 01111011. But we have to print it in reverse order, i.e.., 11011110
program
int main()
{
int i = 123;
while(i!=0)
{
if (i & 1)
printf("1");
else
printf("0");
i >>= 1;
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment