Question: Question: In this lab exam, you are required to write a C program that categorizes a given number of characters as alphabetic, number or special.

 Question: In this lab exam, you are required to write a
C program that categorizes a given number of characters as alphabetic, number
or special. The main function calls the return value function that you

Question: In this lab exam, you are required to write a C program that categorizes a given number of characters as alphabetic, number or special. The main function calls the return value function that you will define. The return value function should receive one character as an input parameter from the main function and return its categorization as an integer value to the calling main function. The main function than prints this categorization in words as described below, and loop for n times where n is a positive integer entered by the user at the beginning denoting the number of characters to be processed in this way. After asking for and getting the number of characters it should process from the user, your program asks for and inputs one character, and should decide about the type of the character entered by calling the return value function, convert and print the categorization and loop for the number of characters entered at the beginning. If the user entered a character between zero and nine inclusive (0-9) it will be named as number. The character will be named as alphabetic if the user entered character as (A-Z or a-z), or any other characters (such as #,1,%,?.... but you don't have to check what these are) will be named as special. You have to use a function named as return value with one input parameter for deciding the type of the character. So, this function should have a character parameter receiving the character as input and has to return an integer value depending on the categorization. If the character is a number, it has to return 1; if character is an alphabetic character, it has to return 2; if the character is a special character (any other character), it has to return 3. In the main function, you should call this function and display the categorization of the characters by turning the categorization value returned by the function (1, 2 or 3) into words (number, alphabetic or special) respectively. You have to use a loop to get the categorization of n characters, one character at a time in each repetition of the loop. Please look at the sample run below. The user entered number 4 at the beginning, the program loops four times, calculating the categorization of four different characters cach input by the user. If 3 is entered as an integer by the user. It loops 3 times for 3 characters. And also, the program displays each character's categorization as "alphabetic", "number" or "special" according to entered character's type as returned by the return value function. Sample Run 1: Enter a positive integer: 4 Enter a character: G G is an alphabetic character. Enter a character: 7 7 is a number character. Enter a character: & & is a special character. Enter a character: A A is an alphabetic character. Press any key to continue Sample Run 2: Enter a positive integer: 3 Enter a character: 4 4 is a number character. Enter a character: A A is an alphabetic character. Enter a character: ? > is a special character. Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!