Thursday, 19 July 2018

Type of Character?

===========================================================================
                                CODING



#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{
clrscr();
char a;
cout<<"\n Enter any character: ";
cin>>a;
if(a>=65 && a<=90)
{
cout<<"\n The character is a capital letter";}
else if(a>=97 && a<=122)
{
cout<<"\n The character is a small case letter";}
else if(a>=48 && a<=57)
{cout<<"\n The character is a digit";}
else if(a>=0 && a<=47 || a>=58 && a<=64 || a>=91 && a<=96 || a>=123 && a<=127)
{cout<<"\n The character is a special character";}
getch();
}

===========================================================================


                                OUTPUT


No comments:

Post a Comment