fork download
  1. #include <iostream> // input/output handling
  2. #include <cctype> // character type functions
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. char ch;
  8. cout << "Enter a character: ";
  9. cin >> ch;
  10. cout << "The toupper(" << ch << ") = " << (char)toupper(ch) << endl;
  11. cout << "The tolower(" << ch << ") = " << (char)tolower(ch) << endl;
  12. if (isdigit(ch))
  13. cout << "'" << ch <<"' is a digit!\n";
  14. else
  15. cout << "'" << ch <<"' is NOT a digit!\n";
  16. }
  17.  
Success #stdin #stdout 0s 3144KB
stdin
5
stdout
Enter a character: The toupper(5) = 5
The tolower(5) = 5
'5' is a digit!