Recursive Function for Greatest Common Divisior

babarsaed's Avatar, Join Date: Oct 2007
Newbie Member
Q.write programe for the greatest common divisor of integers X and Y is the largest interger the evenly divides both X and Y. write a recursive function gcd that returns tha greatest common divisior of X and Y. the gcd of X and Y is defined recursivly as follows: if Y is equal to 0. then gcd (X,Y) is X; otherwise gcd (X,Y) is gcd (Y,X%Y) whre % is the modulus Operator.
DaWei's Avatar, Join Date: Dec 2006
Team Leader
No, thanks. That's YOUR assignment. We'll help you with your code, though.