Use C language plz.
Write a program that reads in a non-negative integer n, and computes the nth Fibonacci number. The nth Fibonacci number, denoted fib(n), is defined below: 0, when n = 0 fib(n) = 1, = when n = 1 (fib(n - 1) + fib(n - 2), when n > 1 Your program should include i.a recursive sub-function that returns fib(n), and its prototype is int fib(int n); ii.the main function that reads in n, calls fib() and prints the result to the screen. Below is a sample run of your program. You may assume that the user input is always legal. Х Console program output Please input a non-negative number: 4 The 4th Fibnacci number is: 3 Press any key to continue...
Use C language plz.
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Use C language plz.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!