Q:

C Program To Check Character Is Uppercase, Lowercase Alphabet Or A Digit Or A Special Symbol

belongs to collection: If/Else C Programs to Practice

0

 C Program To Check Character Is Uppercase( Like A,B,C........Z) , Lowercase ( Like a,b,c.....z )  Alphabet Or A Digit ( Like 1,2,3,.......9 ) , Or A Special Symbol ( Like #,@,<,> ) .
To Solve this problem we will use ASCII Value  if character is between 65 to 90 then You Entered UPPER CASE if it is 97 to 122 Then You Entered LOWER CASE if it is between 48 to 57 then it is a DIGIT And Rest Are SPECIAL SYMBOLS.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<stdio.h>
void main()
{
 char a;
 printf("Press Any Key : ");
 scanf("%c",&a);

 if(a>=65 && a<90)
 {
  printf("An Upper Case Letter");
 }
 else
 {
   if(a>=97 && a<=122)
   {
    printf("A lower Case");
   }
   else
   {
     if(a>=48 && a<=57)
     {
      printf("A Digit");
     }
     else
     {
     printf("A Special Symbol\n\n");
     }
   }
 }
}

 

Output:

press Any Key     g

A lowerCase

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Program For Check You Are Eligible For Voting Or... >>