I want to know how to calculate the least common multiple without using a function of two integers please. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

I want to know how to calculate the least common multiple without using a function of two integers please.

19th Mar 2020, 10:40 AM
Rami Joy
Rami Joy - avatar
3 Answers
+ 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++; }
19th Mar 2020, 11:26 AM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
+ 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?
19th Mar 2020, 11:00 AM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
0
I want it in algorithmic language or c program please
19th Mar 2020, 11:10 AM
Rami Joy
Rami Joy - avatar