C – isgraph() function

Prev     Next

  • isgraph( ) function in C language checks whether given character is graphical character or not. Syntax for isgraph( ) function is given below.

int isgraph( int x );

  • All printable characters are graphical characters except space ( ‘  ‘ ).

Example program for isgraph() function in C:

  • In this program, isgraph( ) function checks whether character is graphical character or not.
  • If its a graphical character, it is printed in output. Else, control is coming out of while loop. Output is printed as “fresh” since space (” “) is not a  graphical character and it can’t be printed in output.

Output:

fresh

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

Prev     Next

Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin

Close
We Support JALLIKATTU !!!
We Support JALLIKATTU!
By Fresh2Refresh.com
Show Your Support as well. Thanks!