// ThreeMap.cc // Prints out values of a function 'threemap' #include using namespace std; int threemap (int n) { if (n%2) // n is odd return (3*n+1); else // n is even return (n/2) ; } int main() { int xmin=1; // starting number int xmax=100; // maximum number for ( int x = xmin ; x <= xmax ; x ++ ) { cout << x << " " << threemap( x ) << endl ; } return 0; }