Thursday, February 28, 2019

LCM OF TWO NUMBERS


#include<stdio.h>
void main()
{
 int a,b,i,l;
 printf("enter the first element");
 scanf("%d",&a);
 printf("enter the second element");
 scanf("%d",&b);
 for(i=1;;i++)
 {
  if(i%a==0&&i%b==0)
  {
   l=i;
   break;
  }
 }
 printf("%d",l);
}

No comments:

Post a Comment