Quote (carteblanche @ Nov 30 2013 12:54pm)
i recommend you post what your problem is.
We are using multi-dimensional arrays to house the fractions..so something like: complete the following code (that will reduce a fraction)
int gcd(int a, int b )
{
if (a == 0 && b == 0) {
printf("Illegal args to gcd: %d, %d\n",a,b);
exit(1);
}
int aa = abs(a);
int bb = abs(b);
if (aa == 0)
return bb;
if (bb == 0)
return aa;
return gcd(bb,aa%bb);
}
void reduce_fraction(Fraction *R)
{
}
This post was edited by SleepyUnit on Nov 30 2013 01:46pm