Skip to content

Instantly share code, notes, and snippets.

@rodrigoalvesvieira
Created March 20, 2014 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodrigoalvesvieira/9657331 to your computer and use it in GitHub Desktop.
Save rodrigoalvesvieira/9657331 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int recursion(int n)
{
if (n == 1) return 7;
return recursion(n-1) + 5;
}
int main()
{
int N;
while(scanf("%d", &N), N != 0) {
printf("%d\n", recursion(N));
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment