View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59