/Explore Pass by Value and pass by reference

#include <iostream>
using namespace std;
void addOne(int);  //prototype
void addTwo(int &); //prototype - pass by reference
float add(float a, float b); //pass by value
int main(void)
{
	int myInt = 5;
	//addOne(myInt);   //THIS IS PASS BY VALUE
	//cout<< myInt <<endl; //PARAMETER PASSED IS  NOT CHANGED
	//***********************************************************
	//PASS BY REFERENCE
	cout << "Before we call addTwo() myInt is " << myInt << endl;
	addTwo(myInt);
	cout << "After we call addTwo() myInt is " << myInt << endl;
	float s = 10;
	float t = 20;
	cout << s << " + " << t << " = " << add(s, t) << endl;
	return 0;
}
//adds 2 to the parameter
void addTwo(int & x)
{
	x = x + 2;
}
//Broken - can't andd two to parameter
void addOne(int x)
{
	x=x+1;
}
float add(float a, float b)
{
	return a + b;
}

//EXERCISE: write a function that swaps two values swap(x,y);
