Question: Considering the following recursive C function, what is the output of mystery(7)? int mystery (int num) if (num ==1 || num==2) return 1; else


Considering the following recursive C function, what is the output of mystery(7)?

 

Considering the following recursive C function, what is the output of mystery(7)? int mystery (int num) if (num ==1 || num==2) return 1; else return mystery (num-1) + mystery (num-2);

Step by Step Solution

3.39 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution The output of mystery7 is 13 This is because the fu... View full answer

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 Programming Questions!