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