-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathex15.cpp
More file actions
44 lines (34 loc) · 678 Bytes
/
ex15.cpp
File metadata and controls
44 lines (34 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
CPSC 121-0X
Paul De Palma
depalma
Example 15
*/
//<= and >=, nested if
#include <iostream>
using namespace std;
int main()
{
char inp;
int inpT;
bool good = false;
cout << "Type a character" << endl;
cin >> inp;
inpT = static_cast<int>(inp);
if (inpT >= 65)
if (inpT <= 90)
{
cout << "You have input an upper case alphabetic character" << endl;
good = true;
}
else
if (inpT >= 97)
if (inpT <= 122)
{
cout << "You have input a lower case alphabetic character " << endl;
good = true;
}
if (!good)
cout << "You have input a non-alpabetic character" << endl;
return 0;
}