Question: C Program . Relevant comments and intentions should be included. thanks. a2: (Iteration instead of Recursion) (33 points) Any recursive program can be written using


C Program . Relevant comments and intentions should be included. thanks.
a2: (Iteration instead of Recursion) (33 points) Any recursive program can be written using iteration instead of recursion. In lecture, you were given a recursive example of the Fibonacci series. Write a non recursive function fibonnaci(n) that calculates the nth Fibonacci number. Student design of prompts and responses. You can restrict your program calculate Fibonacci numbers less than or equal to 45 to avoid integer overflows. Again, you may NOT use recursion. 03: (Recursive Exponentiation) (34 points) Write a recursive function power( base, exponent) that when invoked returns baseexponent For example, power( 3, 4) 3 3 * 3* 3. Assume that exponent is an integer greater than or equal to 1. Hint: The recursion step would use the relationship baseexponent-base* baseexponent-1 and the terminating condition occurs when exponent is equal to 1 because base base Your program should romg for the base and esponent
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
