int a = 0b1011011011;
int b = 0b1000110110;
int c = 0b0101010101;
int d = (a & b) ^ c; //Wrong
Intended value ofd is 0b1010011110
I need to write d so that when the bit of c is 1, the corresponding bit in the result is the corresponding bit in b, but when the bit of c is 0, the corresponding bit in the result is the corresponding bit in a.
I've been stuck on this for awhile now and I can't seem to come up with something in one line.