#include #include using namespace std; bool is_2 (int); bool is_even (int); //******************************************************* // difference between character 2 and integer 2 int main() { char ch = '2'; int i = 2; cout << ch << " is a digit: " ; if (isdigit(ch)) cout << "yes" << endl; else cout << "no" << endl; cout << i << " is a digit: " ; if (isdigit(i)) cout << "yes" << endl; else cout << "no" << endl; cout << endl; cout << setfill('0'); cout << ch << " = x'" << hex << setw(2) << (int) ch << "'" << dec << endl; cout << i << " = x'" << hex << setw(2) << (int) i << "'" << dec << endl; } /******************************************************* 2 is a digit: yes 2 is a digit: no 2 = x'32' 2 = x'02' */