View Code of Problem 59

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int a,b,c,d;
	scanf("%d%d",&a,&b);
	d=a*b;
	while(a%b!=0){
		
		c=a%b;
		a=b; 
		b=c;

	}
	printf("%d %d",d/b,b);
	
} 

Double click to view unformatted code.


Back to problem 59