English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

3 answers

put these two functions in a C program

int gcd(int x, int y)
{
if (y == 0)
{
return x;
}

return (x < y) ? gcd(x, (y % x)) : gcd(y, (x % y));
}


int lcm(int x, int y)
{
return (x * y) / gcd(x, y);
}

2006-07-03 06:08:11 · answer #1 · answered by iyiogrenci 6 · 0 0

Here's a page with a description for the algorithms for finding a Least Common Multiple:

http://www.helpwithfractions.com/least-common-multiple.html

2006-07-03 13:13:01 · answer #2 · answered by Kryzchek 4 · 0 0

for all such queries u can see this web site http://analysingc.50webs.com

2006-07-03 17:59:28 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers