You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function returns the number from the fibonacci's sequence on the given position
Syntax:
fibonacci(n)
Argument
Description
int n
Position in the fibonacci's sequence
Returns:int
Description:
Fibonacci's sequence is an infinite row of numbers. Each number is the sum of the two preceding ones, starting from 0 and 1. The beginning of the sequence is thus: 0, 1, 1, 2, 3, 5, 8, 13, 21,... This function returns a number on the given position.
Example:
intvalue=fibonacci(6);
0, 1, 1, 2, 3, 5, 8. This function will return the number in sequnce on the 6th position (counting from 0). So this function will set value to 8.