isgraph() फंक्शन का उपयोग यह जांचने के लिए किया जाता है कि पास किया गया कैरेक्टर का ग्राफिकल प्रतिनिधित्व है या नहीं। यह ctype.h हेडर फाइल में घोषित है।
C भाषा में isgraph() का सिंटैक्स यहाँ है,
int isgraph(int char);
C भाषा में isgraph() का एक उदाहरण यहाँ है,
उदाहरण
#include <stdio.h>
#include <ctype.h>
int main()
{
int a = '\n';
int b = '8';
int c = 's';
if(isgraph(a))
printf("The character has graphical representation\n");
else
printf("The character isn't having graphical representation\n");
if(isgraph(b))
printf("The character has graphical representation\n");
else
printf("The character isn't having graphical representation");
if(isgraph(c))
printf("The character has graphical representation\n");
else
printf("The character isn't having graphical representation");
return 0;
}
आउटपुट
The character isn't having graphical representation The character has graphical representation The character has graphical representation
उपरोक्त प्रोग्राम में, तीन वेरिएबल घोषित और आरंभ किए जाते हैं। इन वेरिएबल को जांचा जाता है कि उनका ग्राफिकल प्रतिनिधित्व है या नहीं isgraph() फंक्शन का उपयोग करके।
if(isgraph(a))
printf("The character has graphical representation\n");
else
printf("The character isn't having graphical representation\n");