1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zhuklara [117]
3 years ago
13

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te

rms will be:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

a term index is entered and Fibonacci sequence is calculated up to that term.

If the index is 5 then the sequence is : 0, 1, 1, 2, 3

if the index is 7 then the sequence is : 0, 1, 1, 2, 3, 5, 8

Write a program that will print the Fibonacci sequence to the term index entered by the user.

The program will ask you if you want to print another sequence; if Yes repeat if No end your program
Computers and Technology
1 answer:
AlexFokin [52]3 years ago
3 0

//C++:

#include <iostream>

#include <string.h>

using namespace std;

int F(int n) {

 if(n == 0) {

   return 0;

 }

 if(n == 1) {

   return 1;

 }

 else  

   return F(n-1) + F(n-2);

 }

int main()

{

   int index;

   int ok=0;

   char x[3];

   do{

   cout<<"index=";cin>>index;

   for(int i=0;i<index;i++)

   cout<<F(i)<<' ';

   cout<<endl;

   cout<<"Repeat? (Yes/No):";

   cin>>x;

   if(strcmp(x,"No")==0)

   ok=1;

   cout<<endl;

   }while(ok==0);

   return 0;

}

You might be interested in
Emma wants to create a web page for her school’s volleyball team. Which of these could she use?
ser-zykov [4K]

Answer:

Emma should use Chrome

3 0
3 years ago
What is credibility in the often-used framework of quality criteria?
andreyandreev [35.5K]

The correct Answer is  A) Confidence in the truth value of the findings.

Explanation:

refers to confidence in the truth value of the findings, is sometimes said to be the qualitative equivalent of internal validity.

6 0
3 years ago
Which of the following is a reason why the comments tool within PDF documents could be helpful? (Select all that apply.)
sveta [45]
You can use it to suggest edits for the document.

You can use it to make a note of clarification for someone else examining the document.

You can use it to cover up mistakes within the document.

That's what I think.
7 0
3 years ago
In 3 to 5 sentences, describe whether or not files should be deleted from your computer. Explain you answer.
daser333 [38]
I mean if your trying to delete like important files I dont think they should be deleted but that is My opinion. But if you do delete them then u could always got to the recycle bin in ur computer to get it back. I hope this helps !!
7 0
3 years ago
Read 2 more answers
Which of the following was the name of the first generation of cell phone networks?
coldgirl [10]

Answer:

1G

Explanation:

1 'G' as in first generation.

Hope this helped. :)

3 0
3 years ago
Other questions:
  • Universal Containers is setting up an external Business Intelligence (BI) system and wants to extract 1,000,000 Contact records.
    11·1 answer
  • To connect multiple usb devices to a single usb port, a ____ can be used.
    12·1 answer
  • (Analyze scores) Write a program that reads an unspecified number of scores and determines how many scores are above or equal to
    10·1 answer
  • In this part, you have to implement a linked list that maintains a list of integers in sorted order. Thus, if the list contains
    13·1 answer
  • Which of the following is an accurate definition of a computer system? A computer system consists of the operating system that t
    6·1 answer
  • Write a program to accept 10 different whole number from the user and store them in a
    11·1 answer
  • Choose the word that matches each definition. : processed facts, how the output is used for making decisions : action performed
    12·2 answers
  • True or False The two types of general construction projects are residential for homes or dwellings and commercial for a commerc
    7·1 answer
  • Electronic evidence on computer storage media that is not visible to the average user is called​ ________.
    14·1 answer
  • if we intend to include a servo motor as an actuator, what feature should we include when selecting a microcontroller?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!