I am very much new to C, and particularly the bit manipulation programs. I was practicing a few and came across a problem termed- "C Program to Check whether the given Integer has an Alternate Pattern". The following is the solution, I couldn't understand exactly what this code does and the question. What does alternate pattern mean?
#include <stdio.h>
void main() {
int num, x, y, count = 0;
printf("enter the number:");
scanf("%d", &num);
x = num << 1;
y = x ^ num;
y = y + 1;
while ((y / 2) != 0) {
if (y % 2 != 0) {
count++;
break;
} else {
y = y / 2;
}
}
if (count) {
printf("false");
} else {
printf("true");
}
}