home *** CD-ROM | disk | FTP | other *** search
- // 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;
- }
-