We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89ef4be commit 4b907b4Copy full SHA for 4b907b4
gcd.c
@@ -50,9 +50,9 @@ int gcd(int a, int b)
50
a = b;
51
b = temp;
52
}
53
- //Base Case is when a equals 0, this tells we are done
+ //Base Case is when a equals 0, this tells we are done (From:"Keep repeating the step until one of the two numbers reaches zero")
54
if(a == 0)
55
return b;
56
- else // Else return our recursive case
+ else // Else return our recursive case (From: repeatedly replace the larger number with the greater number mod the lesser number)
57
return gcd(a, b%a);
58
0 commit comments