Saturday 10 December 2011

Write a program to input a Character and find out it is a Alphabate , Numeric and a Special Symbol in c

#include
#include
void main()
{
char ch;
clrscr();
printf("Enter a charactar");
scanf("%c",&ch);
if(ch>='A'&& ch<='Z' || ch>='a'&& ch<='z') printf("Alphabate"); else if (ch>='0'&&ch<='9')
printf("numeric");
else
printf("special.symbol");
getch();
}

OUTPUT
Enter a character ANAND
Alphabet

No comments:

Post a Comment