
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
isgraph C Library Function
The function isgraph() is used to check that the passed character has a graphical representation or not. It is declared in “ctype.h” header file.
Here is the syntax of isgraph() in C language,
int isgraph(int char);
Here is an example of isgraph() in C language,
Example
#include<stdio.h> #include<ctype.h> int main() { int a = '
'; int b = '8'; int c = 's'; if(isgraph(a)) printf("The character has graphical representation
"); else printf("The character isn’t having graphical representation
"); if(isgraph(b)) printf("The character has graphical representation
"); else printf("The character isn’t having graphical representation"); if(isgraph(c)) printf("The character has graphical representation
"); else printf("The character isn’t having graphical representation"); return 0; }
Output
The character isn’t having graphical representation The character has graphical representation The character has graphical representation
In the above program, Three variables are declared and initialized. These variables are checked that they have graphical representation or not using isgraph() function.
if(isgraph(a)) printf("The character has graphical representation
"); else printf("The character isn’t having graphical representation
");
Advertisements