Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed==========

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

explain the concept of strategy formulation

Answered: 1 week ago