Master Computers and Technology with Fun Quizzes & Brain Teasers!
The Fibonacci sequence begins with 0 and then 1 follows. All subsequent values are the sum of the previous two, for example: 0, 1, 1, 2, 3, 5, 8, 13. Complete the fibonacci() method, which has an index, n, as parameter and returns the nth value in the sequence. Any negative index values should return -1. Ex: If the input is: 7 the output is: fibonacci(7) is 13
Consider the following function prototypes:int test(int, char, double, int);double two(double, double);char three(int, int, char, double);1. Write a c++ statement that prints the value returned by the function test with the actual parameters 5, 5, 7.3, and 'z'.2. Write a c++ statement that prints the value returned by the function two with the actual parameters 17.5 and 18.3 respectively.3. Write a c++ statement that prints the next character returned by the function three. (Use your own actual parameters)