Ctype h C Tutorial

Item Value
Header filectype.h
Declarationint ispunct(int ch);
Returnreturns nonzero if ch is a punctuation character; otherwise zero is returned.
"punctuation" includes all printing characters that are neither alphanumeric nor a space.

#include 
  #include 
  int main(void)
  {
    char ch;
    for(;;) {
      ch = getchar();
      if(ispunct(ch)){
         printf("%c is punctuation\n", ch);
      }
      if(ch == '.'){
         break;
      }
    }
    return 0;
  }
fd
d
w
s
d
.
. is punctuation