Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
ispunct() in C
The function ispunct() is used to check that the passing character is a punctuation or not. It returns zero, if it is not a punctuation, otherwise it returns a non-zero value.
Here is the syntax of ispunct() in C language,
int ispunct(int character);
Here is an example of ispunct() in C language,
Example
#include <stdio.h>
#include<ctype.h>
int main() {
int a = '!';
int b = 'a';
if(ispunct(a))
printf("The character is a punctuation.");
else
printf("
The character is not a punctuation.");
if(ispunct(b))
printf("
The character is a punctuation.");
else
printf("
The character is not a punctuation.");
return 0;
}
Output
The character is a punctuation. The character is not a punctuation.
Advertisements