Please send questions to st10@humboldt.edu .
/*------------------------------------------------------------ 
signature: swap: int& int& -> void

purpose: expects two pass-by-reference integer variables,
         and produces nothing, but AFTERWARDS has the side-effect
         that the value in the 1st will become the new value of
	 the 2nd, and the value in the 2nd will be the original
         value of the 1st

examples:
    int length1 = 5;
    int length2 = 7;
    swap(length1, length2);

    afterwards:
    length1 == 7
    length2 == 5

by: Sharon Tuttle
last modified: 12-3-10
------------------------------------------------------------*/

void swap(int& val1, int& val2)
{
    int temp;

    // carefully swap the values in val1 and val2

    temp = val1;
    val1 = val2;
    val2 = temp;
}