View Code of Problem 59

#include<stdio.h>
int main()
{
    int num1,num2;
    int a,b,t;
    scanf("%d%d",&a,&b);
    if(a<b){
        num1=b;
        num2=a;

    }
    else
    {
        num1=a;
        num2=b;
    }
    while(num2!=0){
        t=num1%num2;
        num1=num2;
        num2=t;
    }
    printf("%d ",a*b/num1);
    printf("%d",num1);

}

Double click to view unformatted code.


Back to problem 59