Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code here tests a user-entered character and returns values depending on whether the character is numeric, upper case, etc. Enter the code, note the

image text in transcribed
image text in transcribed
The code here tests a user-entered character and returns values depending on whether the character is numeric, upper case, etc. Enter the code, note the output, and answer the questions below. Unit 5 Graded Exercise 1.c #include #include 5 6 7 8 int main(void) {printf("Enter a character: "); int - getchar(); if (isdigit(c)- e) printf("user has entered the character: Xc ", c); printf("isalnun(\'Xc1') Xd ", C, isalnum (c)) printf("isxdigit(\' \') - %d ", s, isxdigit()); printf("islower('Xc ) - Xd ", C, is lower()); printf("isupper('%c\') - Xd ", C, isupper()); printf("tolower(\'Xc1') %d ", c, tolower()); printf("toupper(\ 'Xc1') C, toupper()); printf("isspace(\'%c\') - %d C, isspace()); printf("isentrl(\'%c\') = din , C, isentri()); printf("ispunct('%c') - Xd ", C, ispunct()); printf("isprint('%c\") - %d ", C, isprint()); printf("isgraph(\*\) - Xd ", C, isgraph()); } return @ Here is what the output looks like. RACIS126\CIS126 November 2018 Development Unit 5\Unit 5 Graded Exercise Loxe Enter a character: a User has entered the character: a isalnum('a') - 2 isxdigit('a') - 128 islower('a') - 2 isupper('a') - tolower('a') - 97 toupper("a") - 65 isspace('a') - iscntrl('a') = ispunct('a') - isprint('a') - 2 isgraph('a') - 2 Process exited after 4.399 seconds with return value Press any key to continue ... Enter a character: a User has entered the character: a isalnum('a') = 2 isxdigit('a') - 128 islower('a') - 2 isupper('a') = tolower('a') = toupper('a') isspace('a') = iscntrl('a') ispunct('a') = 0 isprint('a') = isgraph('a') = 2 Process exited after 4.399 seconds with return value Press any key to continue ... When the user enters the value of "a." 1. Why does isalum() return the value 2? 2. Why does isxdigit() return the value 128? 3. Why does islower() return the value 2? 4. Why does isupper() return the value 0? 5. Why does tolower() return the value 97? 6. Why does toupper() return the value 65? 7. Why does isspace) return the value 0? 8. Why does iscntri() return the value 0? 9. Why does ispunct() return the value 0? 10. Why does isprint() return the value 2? 11. Why does isgraph() return the value 2

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

More Books

Students also viewed these Databases questions

Question

Describe the accounting process.

Answered: 1 week ago