Question
Strings Write a program reading.c that reads from standard input according to the users choice. The program should ask How would you like to read?
Strings Write a program reading.c that reads from standard input according to the users choice. The program should ask How would you like to read? 1: character by character; 2: word by word; 3: line by line. Default: print Invalid choice. You should write the three procedures below. - The procedure readCharByChar asks the user to enter 5 characters and read them (hint: using %c). - The procedure readWordByWord asks the user to enter 5 words and read them (hint: using %s). - The procedure readLineByLine should ask the user to enter 5 lines and read them (hint: using gets). In each of the three procedures, the values read should be printed to the screen, each on a separate line showing: input index, tab, unit (char, word, or line).
According to the user choice, your program uses a switch statement to call readCharByChar, readWordByWord, and readLineByLine, respectively. Make sure your code is properly indented, your variables have meaningful names, and macro definitions are used when appropriate.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started