#include int main () { unsigned int x, y, gcd, temp, rem; printf("Enter Two Positive Integers (space-separated): "); scanf("%u%u", &x, &y); printf("The Continued Fraction Representation of %u/%u = ", x, y); // computing GCD of x and y gcd = x; temp = y; while ( temp > 0 ) { rem = gcd % temp; gcd = temp; temp = rem; } // normalized fraction x = x / gcd; y = y / gcd; printf("%u/%u : [ ", x, y); do { // iterating over quotients and reminders in continued fraction printf("%u ", x/y); temp = y; y = x % y; x = temp; } while ( y > 0 ); printf("]\n"); return 0; }