View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59