Question: Should be in C language. use all the functions in one code. Should do each and everything asked in question. Use the three recursive functions
Should be in C language. use all the functions in one code. Should do each and everything asked in question. Use the three recursive functions discussed in class for raising a number to a power to compute (1.12)631. For each function, your program should print out the result of exponentiation and the number of times the function is called. Also print the average execution times.



double powr(double a, int n) { if (n == 0) return 1; else return a*powr(a.n-1) } int fpow(double a, int n) { if (n == 0) return 1; ; else { b = fpow(a, n/2); if (n%2 == 0) return b*b; else * return a*b b; } } int fpow(double a, int n) { if (n return 1: else { == 0) * if (n%2 == 0) return fpow(a,n/2) * fpow(a,n/2); return a * fpow(a,n/2) * fpow(a,n/2); else } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
