Question: C language help please! I am currently learning about inline macros and bitwise operators in C. I need to complete a program that takes in

C language help please!

I am currently learning about inline macros and bitwise operators in C.

I need to complete a program that takes in an unsigned int and converts it to different bases (binary, hexadecimal, and decimal) based on the choice of the user and then completes a number of bitwise operations using inline macros. I need to a) exchange odd bytes while leaving the even intact, b) exchange even bytes while leaving odd intact, and c) find the complement of the number.

example output:

swapping even (binary):

number before: 00110011001000100001000100000000 number after: 00110011000000000001000100100010

I figured out an inline macro for hexadecimal numbers with the help of my school lab, but I'm looking for more help with binary and decimal. I would like to figure this out mostly on my own, so I'm more looking for abstract help or ideas on how to approach the problem.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!