Question: Attached is my code, on lines 6 5 - 7 7 , I implemented the function to calculate the exponent of any number. I '

Attached is my code, on lines 65-77, I implemented the function to calculate the exponent of any number. I'm not getting the correct output though, did I type the functions wrong? Attached are the functions and my own code with it's output.Another recursive definition of p(x,n)=xn :
p(x,n)={1ifn=0x*(p(x,n-12))2ifn1isodd(p(x,n2))2ifn1iseven.
 Attached is my code, on lines 65-77, I implemented the function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!