What are character analysis function, explain with C program?

CServer Side ProgrammingProgramming

Character analysis and conversion functions

The predefined functions in “ctype.h” library is for analyzing the character input and converting them.

Analysis functions

1isalpha()An alphabet or not
2isdigit()A digit or not
3isspace()A space, a new line or tab
4ispunct()A special symbol or not
5slower()A lower case letter of alphabet
6isupper()An upper case letter of alphabet
7isalphanumeric()An alphabet/digit or not

Converting functions

tolower()Converts an upper case alphabet to lower case
toupper()Converts a lower case alphabet to upper case


Let us see a program to demonstrate character analysis and conversion functions −

 Live Demo

void main(){
   //Initializing compile time character variable//
char variable = 'A';
   //Reading User I/P//
   //printf("Enter the character : ");
   //Using character analysis function & printing O/p//
   if (isalpha(variable)){
      printf("The character entered is :%c, an alphabet",variable);
   } else {
      printf("The character entered is not an alphabet");


The character entered is :A, an alphabet
Published on 08-Mar-2021 14:23:29