Question: Using C language. Sample Output below: I. Edit, compile, and run the following program on the UNIX shell: A. To get input from the user,

Using C language. Sample Output below:

I. Edit, compile, and run the following program on the UNIX shell: A. To get input from the user, enter these commandline arguments: four characters (any ASCII character) followed by two integers. Otherwise, print error message and end program. B. To convert a string to an integer, use the function atoi(). For example: int integer! = atoi (argv[5] ) ; C. Use data types "unsigned int" and "unsigned char". Be careful with looping, as there wl be no negative integers. D. Function #1 : This unction calculates the two's complement. The function's parameter is one unsigned integer unsigned int). The unction returns a signed integer int which is the two's complement of the parameter Use the one's complement operator to get the one's complement. Add one (1) to the to the one's complement to get the two's complement. E. Function #2: This unction packs four characters into one integer The function's parameters are four unsigncd characters. The unction returns an unsigncd integer Use the left shift operator (>) and the bitwise AND opcrator (&) with a mask to separate the 32-bit integer into four 8-bit parts, and storc thesc four 8-bit parts in thc four 8-bit charactcrs. In othcr words, takc onc 32-bit intcgcr (int) and convcrt it into four 8-bit charactcrs (char) ***Here is an example function prototypc: void unpackCharacters (unsigned int, unsigned char*, unsigned char*, unsigned char*, unsigned char*)i G. Function #4: This function is a circular lcft shift of the bits. The function's parameter arc two unsigncd integers: integerl and integcr2. The function returns an unsigned integcr. This function will rcturn an unsigncd integcr with intcgcr2's bits rotated to the lcft integcrl's numbcr of timcs. You may nccd to usc a mask, left shift opcrator (>) the bitwisc AND opcrator (&), and the bitwisc inclusive OR opcrator (). In other words, when the bits arc shifted to the left by one, the bit in the lcftmost position will be moved to the rightmost position. When the bits are shifted to the left by 2, the 2 bits in thc leftmost position will bc moved to the rightmost position. Etc. One possible solution is for the circular left shift o circularLeftShift(n, x) = (x > 32-n) Replace the "OR" with the inclusive or operator () peration is: H. Here is an outline of the program with the four function prototypes described in the instructions: LastnameFirstnamel6.c I. Your outfit should match the output below. You can use the printbits) function in your code; however, you also need to create your own function that displays the eight bits in a character
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
