Question: PRG255 3.2 (2 marks) Write a C program that uses the bitwise shift operators to shut the The program will ask the user to enter

PRG255 3.2 (2 marks) Write a C program that uses the bitwise shift operators to shut the The program will ask the user to enter an unsigned also how many bits for the shift operation. Display the entered operation in both decimal and binary formats, vise shirt operators to shift the bits to the right >> or the left > m; /* This shifts m bits to the right, and the m least significant bits are lost. The following statements are the same. num = num >> 3; num >>= 3; Show the operation in binary by calling the following function as defined in 3.1, void to binary(unsigned int n); The function converts decimal to binary and outputs the binary characters. Two example runs of the program are as follows, Input an integer number in the range from 0 to 65535 > 565 Input the number of bits to shift > 2 Shift to the left (enter 0) or right (enter 1) 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
