//Program to demonstrate a function calling another function. #include void get_input(int& input1, int& input2); //Reads two integers from the keyboard. void swap_values(int& variable1, int& variable2); //Interchanges the values of variable1 and variable2. void order(int& n1, int& n2); //Orders the numbers in the variables n1 and n2 //so that after the function call n1 <= n2. void give_results(int output1, int output2); //Outputs the values in output1 and output2. //Assumes that output1 <= output2 int main( ) { int first_num, second_num; get_input(first_num, second_num); order(first_num, second_num); give_results(first_num, second_num); return 0; } //Uses iostream.h: void get_input(int& input1, int& input2) { cout << "Enter two integers: "; cin >> input1 >> input2; } void swap_values(int& variable1, int& variable2) { int temp; temp = variable1; variable1 = variable2; variable2 = temp; } void order(int& n1, int& n2) { if (n1 > n2) swap_values(n1, n2); } //Uses iostream.h: void give_results(int output1, int output2) { cout << "In increasing order the number are: " << output1 << " " << output2 << endl; }