// Arup Guha
// 10/10/2017
// Program to check your GCD Calculations.

#include <stdio.h>

int main() {

    int a, b;
    printf("Enter a, b, both > 0, for your gcd calculation.\n");
    scanf("%d%d", &a, &b);

    // We end when there's no remainder.
    while (b != 0) {

        // Here is what gets printed out when we do the algorithm by hand.
        printf("%d = %d x %d + %d\n", a, a/b, b, a%b);

        // Shuffle variables appropriately.
        int savea = a;
        a = b;
        b = savea%b;
    }

    return 0;
}
