public class Fibonacci { public static void main(String agrs[]) { for(int j=1;j<=15;j++) System.out.println(fobi(j)); } public static int fobi(int i) { if(i<=2) return 1; return fobi(i-1) + fobi(i-2); } }
public class Fibonacci { public static void main(String agrs[]) { for(int j=1;j<=15;j++) System.out.println(fobi(j)); } public static int fobi(int i) { if(i<=2) return 1; return fobi(i-1) + fobi(i-2); } }