Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

why we are using #include<ctype.h> in a pragramming

0 votes
asked Jan 26, 2019 by Ravi Dharigond (150 points)

1 Answer

0 votes
answered Jan 26, 2019 by jai (140 points)

The <ctype.h> header file of the C Standard Library declares several functions that are useful for testing and mapping characters.

All the functions accepts int as a parameter, whose value must be EOF or representable as an unsigned char.

All the functions return non-zero (true) if the argument c satisfies the condition described, and zero(false) if not.

Library Functions

Following are the functions defined in the header ctype.h −

Sr.No.Function & Description
1int isalnum(int c)

This function checks whether the passed character is alphanumeric.

2int isalpha(int c)

This function checks whether the passed character is alphabetic.

3int iscntrl(int c)

This function checks whether the passed character is control character.

4int isdigit(int c)

This function checks whether the passed character is decimal digit.

5int isgraph(int c)

This function checks whether the passed character has graphical representation using locale.

6int islower(int c)

This function checks whether the passed character is lowercase letter.

7int isprint(int c)

This function checks whether the passed character is printable.

8int ispunct(int c)

This function checks whether the passed character is a punctuation character.

9int isspace(int c)

This function checks whether the passed character is white-space.

10int isupper(int c)

This function checks whether the passed character is an uppercase letter.

11int isxdigit(int c)

This function checks whether the passed character is a hexadecimal digit.

The library also contains two conversion functions that accepts and returns an "int".

Sr.No.Function & Description
1int tolower(int c)

This function converts uppercase letters to lowercase.

2int toupper(int c)

This function converts lowercase letters to uppercase.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...