![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 09.07.2021 18:00 JesuGranger
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 takes in an index, n, and returns the nth value in the sequence. Any negative index values should return -1.
Ex: If the input is: 7
the out put is :fibonacci(7) is 13
import java. util. Scanner;
public class LabProgram {
public static int fibonacci(int n) {
/* Type your code here. */
public static void main(String[] args) {
Scanner scnr = new Scanner(System. in);
int startNum;
System. out. println("Enter your number: ");
startNum = scnr. nextInt();
System. out. println("fibonnaci(" + startNum + ") is " + fibonacci(startNum));
}
}
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 13:30
In which phase does software coding and testing happen in the spiral model? the spiral model does not have a separate testing phase. both, software coding and testing occurs during the phase.
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 15:30
To increase sales, robert sends out a newsletter to his customers each month, letting them know about new products and ways in which to use them. in order to protect his customers' privacy, he uses this field when addressing his e-mail. attach bcc forward to
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
You know the right answer?
The Fibonacci sequence begins with 0 and then 1 follows. All subsequent values are the sum of the pr...
Questions
![question](/tpl/images/cats/mat.png)
Mathematics, 21.09.2020 23:01
![question](/tpl/images/cats/geografiya.png)
Geography, 21.09.2020 23:01
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/health.png)
![question](/tpl/images/cats/fizika.png)
Physics, 21.09.2020 23:01
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 21.09.2020 23:01
![question](/tpl/images/cats/mat.png)
Mathematics, 21.09.2020 23:01
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 21.09.2020 23:01
![question](/tpl/images/cats/es.png)
Spanish, 21.09.2020 23:01
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 21.09.2020 23:01
![question](/tpl/images/cats/mat.png)
Mathematics, 21.09.2020 23:01