View Code of Problem 59

#include<stdio.h>
main()
{
	int a,b,x,temp;
	scanf("%d%d",&a,&b);
	x=a*b;
	while(b!=0)
	{
		temp=a%b;
		a=b;
		b=temp;
	}
	printf("%d %d\n",x/a,a);
}

Double click to view unformatted code.


Back to problem 59