Question: ========== you are supposed to write c code, and solve problems using bitwise operations. Read carefully and full answers please. thank you. Write an c
==========
you are supposed to write c code, and solve problems using bitwise operations. Read carefully and full answers please. thank you.
Write an c program that would take 2 input, say a and b. The output of that program would be (a*2)xor (b * 4) xor (a % 2 or b % 2) Note that, for doing this, you are not allowed to use any arithmetic (multiplicative. additive or moduluS) operator. Only bitwise operators like xor, or, and, shift etc are only allowed Input a=2, b = 3 a=6, b = 4 a=5,b= 1 Output 28 15 Hints: Try to learn, how to multiply any number by 2, and do modulus operation - using bitwise operator
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
