develop a program to calculater the least common multiple of
1个回答

#include

void main()//辗转相除法求最大公约数,然后最小公倍数=a*b/最大公倍数

{

int m, n, a, b, t, c;

printf("Input two integer numbers:n");

scanf("%d%d", a, b);

m=a;n=b;

while(b!=0)/* 余数不为0,继续相除,直到余数为0 */

{ c=a%b;

a=b;

b=c;}

printf("The least common multiple:%dn", m*n/a);

}