// fdemo1.cpp: Demonstration program with a function
#include <iostream>
using namespace std;
float fun(float x, float y, int i, int j) {
 float a = x - y;
 int b = i - j;
 return b != 0 ? a/b : a > b ? +1e20F : a < 0 ? -1e20F : 0.0F;
 }

int main() {
 int ii, jj;
 float xx, yy;
 cout << "Enter teo real numbers followed by two integers\n";
 cin >> xx >> yy >> ii >> jj;
 cout << "Value returned by function: "
      << fun(xx, yy, ii, jj) << endl;
 return 0;
}
