Lab Exercise: Write a java program to print the fibonacci number at index 4 ( use recursive call ) public class demo_Lab
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Lab Exercise: Write a java program to print the fibonacci number at index 4 ( use recursive call ) public class demo_Lab
Lab Exercise: Write a java program to print the fibonacci number at index 4 ( use recursive call ) public class demo_Lab { public static void main(String[] args) { System.out.println("The Fibonacci number at index 4 is " + fib(4)); > 7. The method for finding the Fibonacci number */ public static long fib(long index) { 1/ TODO:complete the fib method Il fib(0) = 0; flb(1) = 1; 11 fib(index) = fib(index -1) +fib(index -2); index >=2
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!