## Greatest Common Factors of Fractions

I need help finding GCF of this fraction program
Code:
```#include <iostream.h>
#include <math.h>

int main()
{
// Declare variables
int numerator;		// Numerator for fraction
int denominator;	// Denominator for fraction
int a, b, i;		// a = denominator, b = numerator. i = GCF
int ii;				// GCF
int hold;			// holds output screen

// Get fractions from user
cout << "Enter the numerator : ";
cin  >> numerator;
cout << "Enter the denominator : ";
cin  >> denominator;

// Invalid fractions
if (denominator == 0)
{
cout << "Invalid Operation. Cannot divide fraction by 0." << endl;
}

if (numerator == 0)
{
cout << "Invalid Operation. Numerator cannot be zero." << endl;
}

// Reduce Fractions with For loop
a = denominator;
b = numerator;
for (i = a * b; i > 1; i--)
{
if ((a % i == 0) && (b % i == 0))
{
a /= i;
b /= i;
}
}
cout << endl;

// Print results to screen
cout << "Numerator   = " << b << endl;
cout << "---------     - " << endl;
cout << "Denominator = " << a << endl;
cout << endl;
//cout << "Greatest Common Factor : " << i << endl;
cin  >> hold;
return 0;
}```