Skip to content

Instantly share code, notes, and snippets.

@abhitheawesomecoder
Last active November 10, 2024 17:13
Show Gist options
  • Save abhitheawesomecoder/7b889fa39dbc5d89038ae0f4653311ce to your computer and use it in GitHub Desktop.
Save abhitheawesomecoder/7b889fa39dbc5d89038ae0f4653311ce to your computer and use it in GitHub Desktop.
//fibonaci series using recursion
void main() {
seq(5);
}
seq(int n){
if(n < 0){
return n;
}else{
if(n < 2)
print(n);
else
print((n-1)+(n-2));
return seq(n-1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment