Alright! I have to make a program that computes the n'th Fibonacci number, and then use it in a program to list the first 20 fibonacci numbers, the recursive definition of fibonacci numbers is:
fibonacci(1) = 1
fibonacci(2) = 1
fibonacci(3) = Fibonacci(n-1)+Fibonacci(n-2), for n>2

then modify your program and function to count and print to the console how many recursive calls are performed for counting fiboacci(20).

I dont think i would have a problem figuring out the fibonacci numbers (and i'm sure its on this website correct?) so how would i count the recursions? Using a global variable counter would probably be my start.

use either global or static local variable then just increment it at the beginning of the function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.