Characters ASCII Values
A – Z 65 – 90
a – z 97 – 122
0 – 9 48 – 57
special symbols 0 - 47, 58 - 64, 91 - 96, 123 – 127

Assignments » Flow Of Control » Set 1 » Solution 12

#include<iostream>
using namespace std;

int main ()
{
 char ch;
 cout<<"Enter any character:";
 cin>>ch;

 if (ch>=65 && ch<=90)
  cout<<"Character is a capital letter";
 else if (ch>=97 && ch<=122)
  cout<<"Character is a small letter";
 else if (ch>=48 && ch<=57)
  cout<<"Character is a digit";
 else if ((ch>0 && ch<=47)||(ch>=58 && ch<=64)||
               (ch>=91 && ch<=96)||(ch>=123 && ch<=127))
  cout<<"Character is a special symbol";
 

 return 0;
}



Post a Comment

  1. https://forum.flightradar24.com/member/102423-maytinhdeban/about
    https://forum.topeleven.com/member.php?u=186404
    https://forum.play.eco/core/user/10192-maytinhdeban/#about

    ReplyDelete

 
Top