#include //for cout, cerr, <<, oct, dec, hex #include using namespace std; void print(int n, int base); void print(int n); int main() { int i = 255; print(i, 10); //the function in line 5 print(i, 8); //the function in line 5 print(i, 16); //the function in line 5 print(i); //the function in line 6 return EXIT_SUCCESS; } void print(int n, int base) { if (base == 8) { cout << oct << n << "\n"; } else if (base == 10) { cout << dec << n << "\n"; } else if (base == 16) { cout << hex << n << "\n"; } else { cerr << "base " << base << " must be 8, 10, or 16\n"; exit(EXIT_FAILURE); } } void print(int n) { print(n, 10); //call-through to the function in line 20 }