Skip to content

Instantly share code, notes, and snippets.

@rodrigovidal
Created November 14, 2011 04:59
Show Gist options
  • Save rodrigovidal/1363274 to your computer and use it in GitHub Desktop.
Save rodrigovidal/1363274 to your computer and use it in GitHub Desktop.
Somar recursivo
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