View Code of Problem 59

#include<stdio.h>

int main()
{
	int a,b,t;
	scanf("%d %d",&a ,&b);
	int  m,n;
 	m=a;
 	n=b;
	while ( n!= 0) 
	{
		t = m % n;
		m = n;
		n = t;
	}
	int p;
	p = a*b/m;
	printf("%d %d",p,m);
	return 0;
} 

Double click to view unformatted code.


Back to problem 59