Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

=+7 How has the COVID-19 pandemic impacted the operations of IHRM?

Answered: 1 week ago