Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
simple recursion
#include <stdio.h>
int recursive(int number);
int main(void){
printf("%i\n", recursive(5));
return 0;
int recursive(int number){
if(number <= 1)
return 1;
return number + recursive(number - 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment