Character Is Lower Case,Upper Case,Numeric Or Symbol


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. 


-----

Firoz Memon

Please view my other blogs:

          C++ Codes 4 Beginners

          Java Tips

          Java 4 Beginners

Previous Post Next Post