Question: The left - shift operator can be used to pack four character values into a four - byte unsigned int variable. Write a program that
The leftshift operator can be used to pack four character values into a fourbyte
unsigned int variable. Write a program that inputs four characters from the keyboard
and passes them to function packCharacters. To pack four characters into an unsigned
int variable, assign the first character to the unsigned int variable, shift the unsigned int
variable left by bit positions and combine the unsigned variable with the second
character using the bitwise inclusive OR operator. Repeat this process for the third and
fourth characters. The pro gram should output the characters in their bit format before
and after they're packed into the unsigned int to prove that the characters are in fact
packed correctly in the unsigned int variable. WRITE THIS IN C AND FROM SCRATCH PLEASE.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
