what if you want to check if a value is equal to 2 numbers that are off by only 1 number, i.e: 10 and 11. you take the number your checking, and or it with 1, then check if it's equal to the odd number of the 2 values.
so thusly i give you:
http://codepad.org/Xpa8z9yr
#include<stdio.h>
int main(int argc, char **argv){
int oddnbr = 11;
for(int i=0;i<100;i++) if((i|1)==oddnbr) printf("i: %d\n", i);
return 0;
}
and just incase your even number is greater than your odd number:http://codepad.org/mRB6PBvL
#include<stdio.h>
int main(int argc, char **argv){
int oddnbr = 11;
for(int i=0;i<100;i++) if(((i-1)|1)==oddnbr) printf("i: %d\n", i);
return 0;
}
alright, ganna head back to bed now.