/* ~cs35/switchem.cpp
	To introduce some ideas on moudlarity and on call-by-reference
*/

#include "CS35lib.h"

void switchem(int& first, int &second)//& here is a 2-way communicatortosend bac
{
	int temp;
	
	temp= second;  // save origional value of first
	second = first;
	first = temp;

}


int main ()
{
	int a, b, c, d;
	
	cout << "Enter two numbers, and I'll put them in order for you: \n";
	cin  >> a >> b;
	
	if (a > b) switchem (a, b);

	cout << "From low to high, the numbers are "<<a<<"  " << b << endl;
	return 0;
}

//	cout << "From low to high, the numbers are "<<a<<"  " << b << endl;

// Modify to put THREE numbers in order.
