// Program to illustrate the use of Pass by Reference vs Pass by Value parameters

#include <iostream>
using namespace std;

void newval(float&, float&, float); // function prototype with
//two reference parameters, one value

void main()
{

float num_1= 12.5, num_2= 5.2, num_3= 1.2;

cout << "num_1 is: " << num_1 << endl;
cout << "num_2 is: " << num_2 << endl;
cout << "num_3 is: " << num_3 << endl << endl;

newval(num_1, num_2, num_3);

cout << "num_1 is now: " << num_1 << endl;
cout << "num_2 is now: " << num_2 << endl;
cout << "num_3 is now: " << num_3 << endl;
}

void newval (float& x, float& y, float z) // function definition
{
cout <<" x is: " << x << endl;
cout <<" y is: " << y << endl;
cout <<" z is: " << z << endl << endl;
x = 52.7;
y = 88.5;
z = 999.3;

return;
}







// num_1 is: 12.5
// num_2 is: 5.2
// num_3 is: 1.2
// x is: 12.5
// y is: 5.2
// z is: 1.2
// num_1 is now: 52.7
// num_2 is now: 88.5
// num_3 is now: 1.2
// Press any key to continue