View Code of Problem 59

#include<stdio.h>
int  main(){
    int a[100];
    int p=0,r,t,n,m;
    scanf("%d %d",&n,&m);
	if(n<m){
	  t = n;
	  n = m; 
	  m = t;
	}
     p=n*m;
     while(m!=0){
	r = n%m;
	n = m;
	r = m;
     }
 
     printf("%d %d",n,p/n);
     
     return 0;
}

Double click to view unformatted code.


Back to problem 59