public class fibonachi{
public int fibo(int n){
if(n==0){
return 0;
}
if(n==1){
return 1;
}
return fibo(n-1)+fibo(n-2);
}
}
Driver
public class driver{
public static void main(String [] args){
int result;
fibonachi abc = new fibonachi();
result=abc.fibo(8); //Enter which position of number you want to find out.
System.out.println(result);
}
}The Big Short: Inside the Doomsday Machine
No comments:
Post a Comment