‘C’ program to check if character is alphabet, digit or special symbol.
C File =>
   
/* Write a ‘C’ program to accept a character and check if it is alphabet,  digit or special symbol. If it is an alphabet, check if it is uppercase or  lowercase. */
#include<stdio.h>
#include<ctype.h>
int main() 
{
      char c;
      printf("\n Enter any character : ");
      scanf("%c",&c);
      if(isalpha(c))
     {
          if(islower(c))
             printf("\n Lowercase alphabet");
         else
             printf("\n Uppercase alphabet");
      }
      else if(isdigit(c))
            printf("\n You entered Digit");
      else
            printf("It is a special symbol");
      return 0;
}
Comments
Post a Comment
Please do not enter any spam link in message.