Skip to content

Instantly share code, notes, and snippets.

@deyindra
Created March 5, 2016 18:10
Show Gist options
  • Save deyindra/6e6789266fd008b6f44e to your computer and use it in GitHub Desktop.
Save deyindra/6e6789266fd008b6f44e to your computer and use it in GitHub Desktop.
Finding Nth Fibonacci
public static int findingNthFibo(int n, int start, int end){
if(n==1){
return start;
}else if (n==2){
return end;
}else{
return findingNthFibo(n-1,start,end)+findingNthFibo(n-2, start,end);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment