On Aug 12, 9:54 pm, "sumedh sakdeo" <[EMAIL PROTECTED]> wrote: > well i have made this ... > > · Find minimum of n numbers. > > · Run loop from i=1 to minimum number > > · Check if i is divisible by all the three numbers > > · If yes, gcd=i > > · Continue the step till you get the gcd which is less than or equal > to minimum of three numbers > anyone can do it less complexity? > > On 8/12/07, Muntasir Azam Khan <[EMAIL PROTECTED]> wrote: > > > > > Google is your friend. > > > ----- Original Message ----- > > *From:* sumedh sakdeo <[EMAIL PROTECTED]> > > *To:* algogeeks@googlegroups.com > > *Sent:* Sunday, August 12, 2007 9:37 PM > > *Subject:* [algogeeks] Algo to get GCD of given numbers > > > Write algorithm for finding the GCD of given numbers.
Try this http://en.wikipedia.org/wiki/Euclidean_algorithm Once you can find the gcd of two numbers, you can easily extend this to get the GCD of n numbers. gcd(a,b,c )= gcd ( a, gcd( b, c ) ) Hope this helps, Muntasir --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---