An algorithm to check a given character is alphabet, digit, or special symbol.

  1. Start
  2. Enter any character or digit or special symbol as ch.
  3. Check if ASCII value of (ch>=48 && ch<=57) then continue else ‘GOTO Step 6
  4. Print given character is Digit
  5. Goto Step 13
  6. Check if ASCII value of (ch>=65 && ch<=90) then continue else ‘GOTO Step 9
  7. Print given character is Upper Letter
  8. Goto Step 13
  9. Check if ASCII value of (ch>=97 && ch<=122) then continue else ‘GOTO Step 12
  10. Print given character is Lower Letter
  11. Goto Step 13
  12. Print given character is Special symbol.

13. END

Flowchart to check a given character is alphabet, digit, or special symbol.

Flowchat to to check a given character is alphabet, digit, or special symbol.
Flowchat to to check a given character is alphabet, digit, or special symbol.

C-Code to check a given character is alphabet, digit, or special symbol. ( Using ASCII Code value)

#include<stdio.h>
void main()
{
char ch;
printf("enter any charater :");
scanf("%c", &ch);
if(ch>=48 && ch<=57)
{
printf("The given character is digit :");
}
else if(ch>=65 && ch<=90)
{
printf("The given character is Capital Alphabet");
}
else if(ch>=97 && ch<=122)
{
printf("The given character is small Alphabet");
}
else
{
printf("The given character is special symbol");
}
} 

C-Code to check a given character is alphabet, digit, or special symbol.

#include <stdio.h>
int main()
{
    char ch;
    printf("Enter any character: ");
    scanf("%c", &ch);    /* Input character from user */
    if(ch >= 'a' && ch <= 'z')    /* To check  lower alphabet*/
    {
        printf("'%c' is Lower Case Alphabet.", ch);
    }
          else if(ch >= 'A' && ch <= 'Z')   /* to check upper alphabet */     
            {
              printf("'%c'  is Upper Case Alphabet.", ch);
            }
     else if(ch >= '0' && ch <= '9')
    {
        printf("'%c' is digit.", ch);
    }
    else
    {
        printf("'%c' is special character.", ch);
    }
    return 0;
} 
  1. C-Code to check a given character is alphabet, digit, or special symbol. ( Using C library/in-built function.)
#include <stdio.h>
#include<ctype.h>
int main()
{
            char ch;
            printf(" Please Enter any character :  ");
            scanf("%c", &ch);
            if (isupper(ch))
           {
                        printf("\n %c is Catital Alphabet", ch);
            }
            else if(islower(ch))
            {
            printf("\n %c is lower Alphabet", ch);
   }
            else if (isdigit(ch))
            {
                        printf("\n %c is a Digit", ch);
            }
            else
            printf("\n %c is a Special Character", ch);
            return 0;
}