Created
November 4, 2013 18:28
-
-
Save einarwh/7307079 to your computer and use it in GitHub Desktop.
Tail call recursive Add method.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int Add(int x, int y) | |
{ | |
return x > 0 ? Add(x - 1, y + 1) : y; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment