Answered step by step
Verified Expert Solution
Question
1 Approved Answer
========== 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 operatorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started