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
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