#include #include using namespace std; int main() { for (;;) { //infinite loop, until we break out of it below cout << "Please type an integer in hexadecimal: "; int i {0}; cin >> hex >> i; //iomanipulator works for input, too if (!cin) { //If the user typed something other than an int, break; //out of the for loop } cout << uppercase << hex << i << " in hexadecimal is " << dec << i << " in decimal.\n"; } return EXIT_SUCCESS; //Arrive here when we break out of the loop. }