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);
}
/*
Main.c: In function 'main':
Main.c:9:18: error: lvalue required as left operand of assignment
     if(i%a=0&&i%b=0)
                  ^
*/

Double click to view unformatted code.


Back to problem 59