Question: Write a C program to ask the user for an integer n, loop n times. Each time, ask the user for a char, check that
Write a C program to ask the user for an integer n, loop n times. Each time, ask the user for a char, check that the input received is that type, and then either terminate with an error message or ask for another input until the user has given n correct inputs.
The output of this program should look like this, assuming that the user gives n = 2 correct inputs of type char:
Hello! How many chars should I take? 2 Please give me a char: a
Thanks! Please give me another char: b Thanks! I am happy with 2 chars.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
