// Example of a default value in a function
// The change in potential energy of a body is returned by
// a function given the mass(m),  change in height(h), and
// acceleration due to gravity(g).  Passing  the  value of
// g is optional, the default value being 9.81.
#include <iostream>
using namespace std;

double dP(double m, double h, double g = 9.81) {
  return m*g*h;
}

int main()
{
  cout << dP(1.5,25.,9.81) << endl;
  cout << dP(1.5,25.) << endl;
  cout << dP(1.5,25.,6.23) << endl;
}
