// HexAdd.C // (c) Burton Rosenberg 1996 // Introduce Hexadecimal notation, Two's complement // arithmetic. #include void main() { int i, j ; cout << "Enter (decimal) integer: " ; cin >> i ; cout << "Enter (decimal) integer: " ; cin >> j ; cout.setf(ios::hex,ios::basefield) ; // set to hexadecimal output cout.setf(ios::showbase) ; cout << i << " + " << j << " = " << (i+j) << endl ; }