Pages

Saturday, 19 May 2012

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


30/*Write a program to input a Character and find out it is a Alphabate , Numeric and a Special Symbol*/

#include<stdio.h>
#include<conio.h>
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