- 1
I want to know how to calculate the least common multiple without using a function of two integers please.
3 odpowiedzi
+ 3
Rami Joy
int x=108;
int y=120;
int min = (x > y) ? x : y;
while(1){
if(min%x==0 && min%y==0){
printf ("%d",min);
break;
}
min++;
}
+ 2
Rami Joy most of the programmers does like this
big=#greater of two numbers between x and y
while(True):
if(big % x == 0 and big % y == 0):
lcm = big
break
big+=1
And i quite confused what your question wants?
0
I want it in algorithmic language or c program please