The Fibonacci sequence is defined as the sequence that begins with 0 and 1, and every other number in the sequence is the sum of the two preceding numbers. Write a recursive method that computes the number in the Fibonacci sequence.

What will be an ideal response?

```
public int fibonacci(int n)
{
if(n == 1) return 0;
if(n == 2) return 1;
return fibonacci(n-1) + fibonacci(n-2);
}
```

Computer Science & Information Technology

You might also like to view...

Form Controls are on the Developer tab

Indicate whether the statement is true or false

Computer Science & Information Technology

A(n) ____ procedure does not return a value.

A. Sub B. Function C. Assignment D. Static

Computer Science & Information Technology