#include <iostream>
#include <cmath>
using namespace std;

// Forward declarations
float calculateDistance(float, float);
void inputSides(float&, float&);

int main()
{
	float sideA, sideB; // These are only valid inside main
	
	inputSides(sideA,sideB); // Uses call-by-reference to ensure the variables are actually changed
	
	float distance = calculateDistance(sideA,sideB); // uses call-by-value, since sides are not changed
	
	cout << "The distance is " << distance << endl;
	
	return 0;
}

float calculateDistance(float a, float b)
{
	return sqrt(a*a+b*b);
}


void inputSides(float &sideA, float &sideB) // The & symbol denotes call-by-reference
{
	cout << "Enter Side A: "; cin >> sideA;
	cout << "Enter Side B: "; cin >> sideB;
	// void return type, so return can be omitted.
	// changes to sideA and sideB are reflected in the calling function
}	