Answer:
function fibonacci(n):
if n is equal to 1 or n is equal to 2:
return 1
else:
return fibonacci(n-1) + fibonacci(n-2)
end of the function
Input the n
Print fibonacci(n)
Explanation:
* The above algorithm (pseudocode) is written considering Python.
Create a function called fibonacci that takes one parameter, n
If n is equal to 1 or 2, return 1 (When n is 1 or 2, the fibonacci numbers are 1)
Otherwise, return the sum of the two previous numbers (When n is not 1 or 2, the fibonacci number is equal to sum of the two previous numbers)
Ask the user for n
Call the function, pass n as a parameter and print the result