home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tybc4
/
if3.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-19
|
477b
|
20 lines
// Program demonstrates the multiple-alternative if statement
#include <iostream.h>
main()
{
char c;
cout << "Enter a character : ";
cin >> c;
if (c >= 'A' && c <= 'Z')
cout << "You entered an uppercase letter\n";
else if (c >= 'a' && c <= 'z')
cout << "You entered a lowercase letter\n";
else if (c >= '0' && c <= '9')
cout << "You entered a digit\n";
else
cout << "You entered a non-alphanumeric character\n";
return 0;
}