View Code of Problem 59

    #include<stdio.h>
    #include<string.h>
    int main()
	{
		int i,j,x,y,temp;
		int a,b;
		scanf("%d %d",&a,&b);
        i=a;
		j=b;
		if(a<b)
		{
			temp=a;
			a=b;
			b=temp;
		}
		while(b!=0)
		{
			temp=a%b;
			a=b;
			b=temp;
		}

		x=a;
		y=i*j/x;
        printf("%d %d\n",y,x);
          

    }

Double click to view unformatted code.


Back to problem 59