View Code of Problem 59

#include<stdio.h>
int main()
{
    int x, y, z, m, n;
    scanf("%d%d", &x, &y);
    m = x, n = y;
    while (y != 0)
    {
        z = x%y;
        x = y;
        y = z;
    }
    printf("%d ", m*n / x);
    printf("%d", x);
    
    return 0;
}

Double click to view unformatted code.


Back to problem 59