C ispunct()

The ispunct() function returns non-zero if ch is a punctuation character; otherwise zero is returned. The term "punctuation", as defined by this function, includes all printing characters that are neither alphanumeric nor a space.

ispunct() Syntax

Following is the syntax of the ispunct() function :

int ispunct(int ch);

ispunct() Example

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

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

C Online Test

« Previous Chapter Next Function »

Like/Share Us on Facebook 😋