ispunct Function

  • It test the given character, whether it is any punctuation character (any printing character except for space character or isalnum) .
  • It returns nonzero if ch is a punctuation character; otherwise zero is returned.

  • Syntax :
    int punct(int ch);

    Example

    
    #include <ctype.h>
    
    #include <stdio.h>
    
      void main() {
    
    	char ch='.';
    
    	if(ispunct(ch)) {
    
    		printf("%c is punctuation\n", ch);
    
    	}
    
    }
    
    

    Output