previous | start | next

Test Program

#include "fraction.h"

int main()
{
  Fraction f1(1,4);
  Fraction f2(1,2);
  Fraction f;

  f = f1 + f2;

  cout << "Expecting 1/4 + 1/2 = 3/4" << endl;
  cout << "1/4 + 1/2 = " << f.getNumerator() << "/" << f.getDenominator << endl;

  return 0;
}


previous | start | next