Write recursive functions to compute factorialn and


In many textbooks, the first examples of recursion are the mathematical functions factorial and fibonacci. These functions are defined for non-negative integers using the following recursive formulas:

factorial(0) = 1

factorial(N) = N*factorial(N-1) for N > 0

fibonacci(0) = 1

fibonacci(1) = 1

fibonacci(N) = fibonacci(N-1) + fibonacci(N-2) for N > 1

Write recursive functions to compute factorial(N) and fibonacci(N) for a given non-negative integer N, and write a main() routine to test your functions.

Request for Solution File

Ask an Expert for Answer!!
Science: Write recursive functions to compute factorialn and
Reference No:- TGS01377686

Expected delivery within 24 Hours