Write code to implement the following function: /* Return 1 when any odd bit of x equals
Fantastic news! We've Found the answer you've been seeking!
Question:
This is C code. I just want to understand this code clearly. Specifically when copmaring the bits with the and opperator.
#include
int any_odd_one(unsigned x)
{
return (x & 0x55555555) && 1; <------------------------ Can you explain what is going on here?
}
int main()
{
unsigned j;
printf("Enter integer ");
scanf("%u",&j);
printf("%d",any_odd_one(j));
}
Related Book For
Computer Organization and Design The Hardware Software Interface
ISBN: 978-0124077263
5th edition
Authors: David A. Patterson, John L. Hennessy
Posted Date: