codescracker


c

C isprint()



« Previous Chapter Next Function »


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 :

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

isprint() 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(isprint(ch))
			printf("%c is printable\n", ch);
		if(ch == '.')
			break;
	}
	getch();
}

« Previous Chapter Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test