All characters like small letters, capital letters, digits or special character have ASCII codes when a key is pressed from keyboard there is always an ASCII value behind it like if small letter 'a' is pressed its ASCII is 97 if capital letter 'A' is pressed its ASCII value is 65 if a number digit '0' is pressed its ASCII value is 48.
ASCII value ranges
0 - 9 48 - 57
A - Z 65 - 90
a - z 97 - 122
Special Characters 0-47, 58-64, 91-96, 123-127
On the basis of ASCII values and using operators like and operator (&&) or Operator (||) we can differentiate the letters.
If you enter more that one character program will show the result on the basis of first charater
|C++ program to check the entered character is a capital letter, a small letter, a digit or a special character|
This Program helps to understand the operators like OR operator(||) how if else works, and ASCII values of characters