Item Value
Header filectype.h
Declarationint isgraph(int ch);
Returnreturns nonzero if ch is a printable character other than space or zero is returned.
For ASCII environments, printable characters are in the range 0x21 through 0x7E.
#include
#include
int main(void)
{
char ch;
for(;;) {
ch = getchar();
if(isgraph(ch)){
printf("%c is printable\n", ch);
}
if(ch == '.'){
break;
}
}
return 0;
}
1
1 is printable
2
2 is printable
3
3 is printable
4
4 is printable
.
. is printable