Question: I am trying to write this example as a c code program ( Another library/header file): So far, you have only used stdio.h header file

I am trying to write this example as a c code program

(Another library/header file): So far, you have only used stdio.h header file which contains standard input/output functions such as printf() and scanf(). In this guided exercise, you will be required to include another header file, ctype.h, which contains built-in character-handling functions. Go ahead and add it to the next line below the existing stdio.h include statement as follows:

#include

3. (Housekeeping): Declare the following variables in your program using appropriate data type. When selecting a data type keep in mind the type of value you want to store, i.e., int, float, character. Also, be sure to use conventional naming standards for all variable declarations

c

4. (Display Prompt): Write a printf() statement to ask user for the following message.

Enter a character:

5. (Input): User either a scanf() statement or getchar() function to store the character the user wishes to store in the computers memory.

6. (Test isdigit( ) function): Now, use isdigit() function to test whether user has entered a character or not as following:

if (isdigit (c) = = 0)

{

printf(" User has entered the character: %c ", c); }

7. (Test other functions likewise): Similarly, test three from the following functions using your own if statement.

isupper()

iscntrl()

ispunct()

8. (Output Screen) Line 1. Enter a character - L, Line 2 User has entered the character L Line 3 isupper('L') = 0, Line 4 iscntrl('L'} = 0, Line 5 ispunct('L') = 0 Line 6 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!