Check lowercase in C++ by R4R Team

Lower-case alphabet:

Example-
a,b,c,d,...........,x,y,z

All these alphabet is of lower case.
ASCII value for lower case alphabet:
a=97
b=98
c=99
.....
y=121
Z=122


program:

#include < iostream>
using namespace std;
int main()
{
char s;
cout<<"Enter any Character"<< endl;
cin>>s;
if(s>='a' && s<='z')
cout<<"It is lower case";
else
cout<<"It is not a lower case";
return 0;
}


output-

Enter any character
G
It is not a lower case

Enter any character
h
It is lower case

-In this program, we take a input of the alphabet and check whether it is a lower case or not.
-if((ch>='a' && ch<='z'))
will execute if alphabet is of lower case otherwise it implies as UPPER case alphabet.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!