// Program 6: AbsoluteDifference.C // (c) Burt Rosenberg 1996 // This program introduces return values for functions. #include int distance ( // Create a procedure object returning an int a, int b ) // integer object, and two integer objects. // Initialize the integer objects. { if ( a> i ; cout << "Enter j:" ; cin >> j ; // Calulate the absolute values of the integers. abs_i = distance( i, 0 ) ; abs_j = distance( j, 0 ) ; // Calculate and print the result. cout << "Abs( " ; cout << "Abs(" << i << ")" ; cout << " - " ; cout << "Abs(" << j << ")" ; cout << " ) = " << distance( abs_i, abs_j ) << endl ; }