Program to check whether entered character is lower case,upper case,numeric or symbol in C++
#include<iostream.h>
#include<ctype.h>
#include<conio.h>
void main()
{
clrscr();
char c;
cout<<"\nEnter Single Letter :: ";
cin>>c;
if(isalnum(c))
{
if(isalpha(c))
{
if(islower(c))
cout<<"\nGiven Letter is a Lowercase Character.";
else
cout<<"\nGiven Letter is a Uppercase Character.";
}
else
cout<<"\nGiven Letter is Numeric.";
}
else
cout<<"\nGiven Letter is Symbol.";
getch();
}
OUTPUT::
Enter Single Letter::l
Given Letter is a Lowercase Character.