// REDUCE.CPP // By Brian Davis #include #include long n=0; long d=0; long a=1; long b=0; long c=0; long e,f,g,i,j; main() { cout << endl << "Enter the numerator (top number): "; cin >> n; cout << endl << "Enter the denominator (bottom number): "; cin >> d; for (a = 1; a <= n; a++) { b = n % a; if (b==0) {cout<<"B= "< g) { cout << " OR" << endl; i = f / g; j = f % g; cout << setw(25) << j << endl << setw(15) << i << setw(10) << "-----" << endl << setw(25) << g; } return 0; }