C isprint()

The isprint() function returns non-zero if ch is a printable character, including a space; otherwise zero is returned. In ASCII environments, printable characters are in the range 0x20 through 0x7E.

isprint() Syntax

Following is the syntax of the isprint() function :

int isprint(int ch);

isprint() Example

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

void main()
	char ch;
	for(; ;)
		ch = getchar();
			printf("%c is printable\n", ch);
		if(ch == '.')

C Online Test

« Previous Chapter Next Function »

Like/Share Us on Facebook 😋