#include <iostream.h>
#include <conio.h>
void main()
{
char ch;
clrscr();
cout<<"Enter a character to see it's ASCII Value: ";
cin>>ch;
if(ch==cin.fail())
{
cout<<"You are not entered a character";
}
else
{
if(ch=='a' || ch=='b' || ch=='c' || ch=='d' || ch=='e' || ch=='f' || ch=='g'
ch=='h' || ch=='i' || ch=='j' || ch=='k' || ch=='l' || ch=='m' || ch=='n'
ch=='o' || ch=='p' || ch=='q' || ch=='r' || ch=='s' || ch=='t' || ch=='u'
ch=='v' || ch=='w' || ch=='x' || ch=='y' || ch=='z')
cout<<"You Enter a character in lower case";
}
cout<<"You enter a caracter in Upper case";
getch();
}
This post has been edited by Salem_c: 03 June 2012 - 08:47 AM
Reason for edit:: Added [code][/code] tags - learn to use them yourself

New Topic/Question
Reply



MultiQuote





|