#include #include "genlib.h" #include "simpio.h" #include "proj3.h" main () { int n1, d1, n2, d2 ; fraction f1, f2, f3; /* Get and make first fraction */ printf("Numerator 1: ") ; n1 = GetInteger() ; printf("Denominator 1: ") ; d1 = GetInteger() ; f1 = MakeFraction(n1,d1) ; /* Get and make second fraction */ printf("Numerator 2: ") ; n2 = GetInteger() ; printf("Denominator 2: ") ; d2 = GetInteger() ; f2 = MakeFraction(n2,d2) ; /* Print them out just to see */ printf ("\nf1 = ") ; PrintFraction(f1) ; printf (", f2 = ") ; PrintFraction(f2) ; printf("\n\n") ; /* Check addition works ... */ f3 = AddFraction(f1, f2) ; PrintFraction(f1) ; printf (" + ") ; PrintFraction(f2) ; printf (" = ") ; PrintFraction(f3) ; printf("\n") ; }