home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tybc4
/
if2.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-19
|
384b
|
19 lines
// Program demonstrates the dual-alternative if statement
#include <iostream.h>
#include <ctype.h>
main()
{
char c;
cout << "Enter a letter : ";
cin >> c;
// convert to uppercase
c = toupper(c);
if (c >= 'A' && c <= 'Z')
cout << "You entered a letter\n";
else
cout << "Your input was not a letter\n";
return 0;
}