Write a C Program to shift bits. You will take input from the command-line argument (i.e argv[1]. Input should be 8 bits long in binary (i.e 01010011).
Shifting means exactly that, shift all the bits in the first operand either left or right the number of time indicated in the second. The second operand should be an integer value. If it is not, then truncate it (pretend the fractional part does not exist). If a shift left would push a bit off of the 'front', it is lost and causes an overflow. Report the overflow and print the bits left over after the shift. If a shift right would push a bit off of the 'back', it is lost and causes an underflow. Report the underflow and print the bits left over after the shift.e.g.(shift 2 to the left 1 time .. in essence multiply by 2)$ ./compu "000101000010"$ OKAY 1000
(shift 2 to the left 1.5 times .. not an int)$ ./compu "000101000011"$ NINT 1000
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here