WAP in C to check whether the given character is capital letter, small letter, digit or special character ?

WAP in C to check whether the given character is capital letter, small letter, digit or special character ?


 Hint     A - Z = 65 - 90
             a - z = 97 - 122
             0 - 9 = 98 - 57
             0 - 10 = 68 - 79

Answer: 

#include<stdio.h>
#include<conio.h>
void main()
{
char a;
printf(" enter any character");
scanf("%C",&a);
if((a>=65)&&(a<=90))
{
printf("The character is capital alphabet");
}
elseif((a>=97)&&(a<=122))
{
printf("The character is small alphabet"): 
}
elseif((a>=48)&&(a<=57))
{
printf("The character is a digit");
}
else
{
printf("The character is a special character"):
}
getch();
}

DONE.....COMPLETED....

Just Comment your questions in the comment box below the post....i will solve it for you...

THANKS FOR VISITING......HAVE A GREAT DAY.......

Post a Comment

0 Comments