Wednesday, February 13, 2013

C Program To check whether a Character is Alphabet, Digit or Special Symbol.

#include <stdio.h>
#include <ctype.h>

void main()
{
char ch;
clrscr();
printf("Enter a character = ");
scanf("%c", &ch);

if (isupper(ch))
{
printf("Character is in Upper case\n");
}
else
if (islower(ch))
{
printf("Character is in Lower case\n");
}
else
if (isdigit(ch))
{
printf("It is a digit\n");
}
else
{
printf("Special Symbol\n");
}
getch();
}


Follow us on Facebook

1 comment: