View Code of Problem 59

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

	return;
}

Double click to view unformatted code.


Back to problem 59