Tutorialspoint

ispunct() in C language

#include <stdio.h>
#include<ctype.h>
int main() {
   int a = '!';
   int b = 'a';
    
   if(ispunct(a))
      printf("The character is a punctuation.");
   else
      printf("\nThe character is not a punctuation.");
         
   if(ispunct(b))
      printf("\nThe character is a punctuation.");
   else
      printf("\nThe character is not a punctuation.");
   return 0;
}

Advertisements
Loading...