//Written by MA Saleh
#include<stdio.h>
int main()
{
int a, b, x;
printf("Enter two number for LCM: ");
while(scanf("%d %d", &a, &b) == 2)
{
if(a > b )
x = a;
else
x = b;
for(;x>=1; x++)
{
if(x%a == 0 && x%b == 0)
{
printf("LCM = %d\n", x);
break;
}
}
printf("Again enter two Number: \n");
}
return 0;
//Copyright@MAS
}
Sample Input: 10 30, 4 28
Sample Output:
Related Post(GCD)
Previous Post(GCD)
0 comments:
Post a Comment