Sorry if this is a duplicate, I couldn't find exactly what I want.
I have the current value of a byte:
00110001 A
And I have to write another value:
10001001 B
but in the 2nd byte only some bits are relevant. The relevant bits are the ones with a one in this bit
11000000 C
The final byte will be B on the bits where C==1 and A on the bits where C==0. How can I do that with no if statements?
The answer is D 10110001
ifis not a loop, it's kind of a branching statement. Anyway, are you looking for the bitwise AND operator?