Prev Next
isxdigit() function in C:
- isxdigit( ) function in C language checks whether given character is hexadecimal or not. Syntax for isxdigit( ) function is given below.
int isxdigit( int x );
Example program for isxdigit() function in C:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#include <stdio.h> int main() { char ch; printf("Enter any character\n"); scanf("%c", &ch); if ( isxdigit ( ch ) ) printf ( "\nEntered character is hexadecimal" ) ; else printf ( "\nEntered character is not hexadecimal" ) ; } |
Output:
Enter any character # Entered character is not hexadecimal |
Other Int, Char validation functions in C programming language:
- All “int, char validation functions” used in C programming language are given below. “ctype.h” header file support all these functions in C language.
- Click on each function name below for detail description and example programs.
Functions | Description |
isalpha() | checks whether character is alphabetic |
isdigit() | checks whether character is digit |
isalnum() | Checks whether character is alphanumeric |
isspace() | Checks whether character is space |
islower() | Checks whether character is lower case |
isupper() | Checks whether character is upper case |
isxdigit() | Checks whether character is hexadecimal |
iscntrl() | Checks whether character is a control character |
isprint() | Checks whether character is a printable character |
ispunct() | Checks whether character is a punctuation |
isgraph() | Checks whether character is a graphical character |
tolower() | Checks whether character is alphabetic & converts to lower case |
toupper() | Checks whether character is alphabetic & converts to upper case |