Write an algorithm for finding the greatest common divisor of two integers.
Ans
function gcd( a,b : Integer ) returns Integer
{
if ( b != 0 )
return gcd( b, a mod b )
return abs(a)
}
Thursday, April 29, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment