3/03/2015

C++ Program To Check Upper Case Lower Case Digit And Special Symbol

Problem :- Write A Program To Check Upper case Lower case Digit And Special Symbol .

Logic :- This is a simple logic we check all the thing with ASCII value or Character we put condition like if character ASCII value is between 97 to 122 then character is lower case or if 65 to 90 then Upper case or if ASCII value is between 48 to 57 then it is Digit .
if above all condition is not true then it is a Special Symbol .

Solution :-

#include<iostream>
using namespace std;
int main()
{
char a;

cout<<"Press Any Key....\n"<<endl;
cin>>a;

if(a>=65 && a<90)
{
cout<<"Key Is Upper Key\n"<<endl;
}

else
{
  if(a>=97 && a<=122)
  {
  cout<<"Key Is Lower Key\n"<<endl;
}
  else
  {
  if(a>=48 && a<=57)
  {
  cout<<"Key Is Degit\n"<<endl;
}
  else
  {
  cout<<"Key Is Special Symbol\n"<<endl;
}
  }
}
return 0;

}

Output :-

C++ Program To Check Upper Case Lower Case Digit And Special Symbol

Ghanendra Yadav

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

No comments:

Post a Comment