Skip to content

Instantly share code, notes, and snippets.

@MaxySpark
Last active September 3, 2016 22:18
Show Gist options
  • Save MaxySpark/f464492b6ffdefadc5827affc09efde3 to your computer and use it in GitHub Desktop.
Save MaxySpark/f464492b6ffdefadc5827affc09efde3 to your computer and use it in GitHub Desktop.
fibonacci function
int fibo(int n){
if(n==0 || n==1){
return 1;
} else {
return fibo(n-1)+fibo(n-2);
}
}
int fibo(int n){
if(n==0 || n==1){
return 1;
} else {
return fibo(n-1)+fibo(n-2);
}
}
public static int fibo(int n){
if(n==0 || n==1){
return 1;
} else {
return fibo(n-1)+fibo(n-2);
}
}
function fibo(n){
if(n==0 || n==1){
return 1;
} else {
return fibo(n-1)+fibo(n-2);
}
}
#include <stdio.h>
int fibo(int n){
if(n==0 || n==1){
return 1;
} else {
return fibo(n-1)+fibo(n-2);
}
}
int main() {
int f,fibonum,i;
printf("Enter The Range For Finding Fibonacci Series : ");
scanf("%d",&f);
printf("\nFibonacci Series To Position : %d\n",f);
for(i=0;i<f;i++){
fibonum = fibo(i);
printf("%d\t",fibonum);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment