Printing Bit

Write a program in a file named print_bits.c that repeatedly displays the following menu to the screen, reads the user input, and performs the desired action.

  1. Display bits for integer
  2. Display bits for float
  3. Display bits for string
  4. Exit

When the user enters 1,2 or 3, the program should prompt the user to enter a value, read the input and validate it, and then print to the screen the bits of each byte for the value entered.  If the user enters invalid input, the program should print “Invalid input” and continue by redisplaying the menu.

When the user ends 4, the program should terminate.

© 2017, Eric. All rights reserved.