Created
November 14, 2011 04:59
-
-
Save rodrigovidal/1363274 to your computer and use it in GitHub Desktop.
Somar recursivo
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
private int SumNumbers(int from, int to) | |
{ | |
if (from > to) return 0; | |
int sumRest = SumNumbers(from + 1, to); | |
return from + sumRest; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment