codescracker


c

C isgraph()



« Previous Chapter Next Function »


isgraph()

The isgraph() function returns non-zero if ch is any printable character other than a space; otherwise zero is returned. For ASCII environments, printable characters are in the range 0x21 through 0x7E.

isgraph() Syntax

Following is the syntax of the isgraph() function :

#include<ctype.h>
int isgraph(int ch);

isgraph() Example

Following program checks each character read from stdin and reports all printable characters :

#include<ctype.h>
#include<stdio.h>
#include<conio.h>
void main()
{
	clrscr();
	char ch;
	for(; ;)
	{
		ch = getchar();
		if(isgraph(ch))
			printf("%c is printable\n", ch);
		if(ch == '.')
			break;
	}
	getch();
}

« Previous Chapter Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test