===========================================================================
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();
}
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();
}
===========================================================================
No comments:
Post a Comment