CPP program to check that the entered character is small, capital or a special character

C++/CPP program to check that the entered character is small, capital or a special character?

Logic of the program

If in the program, Ascii_value_Variable>=97 && Ascii_value_Variable<=122, then the character is small.

If in the program, Ascii_value_Variable>=65 && Ascii_value_Variable<=90, then the character is capital.

If in the program, Ascii_value_Variable>=0 && Ascii_value_Variable>=47 || Ascii_value_Variable>=54 && Ascii_value_Variable<=64 || Ascii_value_Variable>=91 && Ascii_value_Variable<=96 || Ascii_value_Variable>=123 && Ascii_value_Variable<=127,then the character is a special character.

If in the program, Ascii_value_Variable>=47 && Ascii_value_Variable<=57,then it means that you have entered a digit.

Program

.

ASCII Table

ASCII stands for “American Standard Code for Information Exchange”. The ASCII is a character encoding standard developed for representing and exchanging arbitrary text-based information between computers.

DecimalHexOctalBinaryCharDescription
0000000000000NULnull character
1010010000001SOHstart of header
2020020000010STXstart of text
3030030000011ETXend of text
4040040000100EOTend of transmission
5050050000101ENQenquiry
6060060000110ACKacknowledge
7070070000111BELbell (ring)
8080100001000BSbackspace
9090110001001HThorizontal tab
100A0120001010LFline feed
110B0130001011VTvertical tab
120C0140001100FFform feed
130D0150001101CRcarriage return
140E0160001110SOshift out
150F0170001111SIshift in
16100200010000DLEdata link escape
17110210010001DC1device control 1
18120220010010DC2device control 2
19130230010011DC3device control 3
20140240010100DC4device control 4
21150250010101NAKnegative acknowledge
22160260010110SYNsynchronize
23170270010111ETBend transmission block
24180300011000CANcancel
25190310011001EMend of medium
261A0320011010SUBsubstitute
271B0330011011ESCescape
281C0340011100FSfile separator
291D0350011101GSgroup separator
301E0360011110RSrecord separator
311F0370011111USunit separator
32200400100000space
33210410100001!exclamation mark
34220420100010quotation mark
35230430100011#number sign
36240440100100$dollar sign
37250450100101%percent sign
38260460100110&ampersand
39270470100111apostrophe
40280500101000(left parenthesis
41290510101001)right parenthesis
422A0520101010*asterisk
432B0530101011+plus sign
442C0540101100,comma
452D0550101101hyphen
462E0560101110.period
472F0570101111/slash
483006001100000digit 0
493106101100011digit 1
503206201100102digit 2
513306301100113digit 3
523406401101004digit 4
533506501101015digit 5
543606601101106digit 6
553706701101117digit 7
563807001110008digit 8
573907101110019digit 9
583A0720111010:colon
593B0730111011;semicolon
603C0740111100<less than
613D0750111101=equals to
623E0760111110>greater than
633F0770111111?question mark
64401001000000@at sign
65411011000001Auppercase A
66421021000010Buppercase B
67431031000011Cuppercase C
68441041000100Duppercase D
69451051000101Euppercase E
70461061000110Fuppercase F
71471071000111Guppercase G
72481101001000Huppercase H
73491111001001Iuppercase I
744A1121001010Juppercase J
754B1131001011Kuppercase K
764C1141001100Luppercase L
774D1151001101Muppercase M
784E1161001110Nuppercase N
794F1171001111Ouppercase O
80501201010000Puppercase P
81511211010001Quppercase Q
82521221010010Ruppercase R
83531231010011Suppercase S
84541241010100Tuppercase T
85551251010101Uuppercase U
86561261010110Vuppercase V
87571271010111Wuppercase W
88581301011000Xuppercase X
89591311011001Yuppercase Y
905A1321011010Zuppercase Z
915B1331011011[left square bracket
925C1341011100\backslash
935D1351011101]right square bracket
945E1361011110^caret
955F1371011111_underscore
96601401100000`backtick
97611411100001alowercase a
98621421100010blowercase b
99631431100011clowercase c
100641441100100dlowercase d
101651451100101elowercase e
102661461100110flowercase f
103671471100111glowercase g
104681501101000hlowercase h
105691511101001ilowercase i
1066A1521101010jlowercase j
1076B1531101011klowercase k
1086C1541101100llowercase l
1096D1551101101mlowercase m
1106E1561101110nlowercase n
1116F1571101111olowercase o
112701601110000plowercase p
113711611110001qlowercase q
114721621110010rlowercase r
115731631110011slowercase s
116741641110100tlowercase t
117751651110101ulowercase u
118761661110110vlowercase v
119771671110111wlowercase w
120781701111000xlowercase x
121791711111001ylowercase y
1227A1721111010zlowercase z
1237B1731111011{left curly brace
1247C1741111100|vertical bar
1257D1751111101}right curly brace
1267E1761111110~tilde
1277F1771111111DELdelete (rubout)
By:Prof. Fazal Rehman Shamil
CEO @ T4Tutorials
Last Modified: April 19, 2020

Leave a Reply

Your email address will not be published. Required fields are marked *