View Code of Problem 59

#include<stdio.h>
int main()
{
 int a,b,i;
  int x,y;
  scanf("%d %d",&a,&b);
  for(i=1;i<=a&&i<=b;i++)
  {
    if(i%a==0&&i%b==0)
      x=i;
  }
  y=a*b/x;
  printf("%d %d",x,y);
}

Double click to view unformatted code.


Back to problem 59