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
What is the recommended solution to configure this automated behavior? UC has a requirement that an opportunity should have a fi
Dmitry_Shevchenko [17]
The answer will need to be workflow.
8 0
3 years ago
What does Stand for in web design
myrzilka [38]

Answer:

g

Explanation:

h

7 0
2 years ago
In a binary search, _______________________________ . a. It is assumed that all of the elements are integers. b. It is assumed t
madam [21]

Answer:

d. It is assumed that the search pool is ordered.

Explanation:

A binary search/logarithimic search/half interval search/binary chop refers to search algorithm in computer science that sorts data in array in key:value arrangements. In order to locate a value in binary search, the key to the value in a sorted array is located. A binary search is characterized by an ascending, descending order arrangement of the array.

6 0
3 years ago
. What is a computer network? *
Citrus2011 [14]

Explanation:

Pretty sure its a group of two or more computers that are linked thogether

7 0
3 years ago
in this third journal assignment, you will think about your work as the product tester for the travel booking software and how y
Temka [501]

My early test cases were greatly aided by the user stories. They gave a thorough summary of what a user can expect from the product as well as data on their past expectations and experiences.

Explanation:

The intricacies of the user's surroundings and the exact technological needs for the product, however, were absent from the user stories.

Greetings, Software Developers!

I'm trying to create more in-depth test cases for my job as a quality test for the online travel software. To do this, I'd like to learn more about the environment of the user and the software's technical requirements. Please give me more details about the technical specs and the user environment.

I'm grateful.

[Name]

To know more about testing
brainly.com/question/22710306
#SPJ4

3 0
1 year ago
Other questions:
  • Binary search requires that data to search be in order. true or false
    5·1 answer
  • In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sid
    10·1 answer
  • What statement best describes Konrad Zuse?
    6·2 answers
  • A terrible new disease, HORSEVID, has begun to spread among horses worldwide. Stable manager Jimmy is trying to take as many pre
    5·1 answer
  • Henrietta, the owner of a very successful hotel chain in the Southeast, is exploring the possibility of expanding the chain into
    15·1 answer
  • The destructor automatically executes when the class object goes out of ____.
    12·1 answer
  • _________ is a protocol used by e-mail clients to download e-mails to your computer. (
    6·1 answer
  • The Turing test consists of a person asking written questions of a person and a computer. If the questioner can't tell which one
    13·1 answer
  • Plz subscribe my yt gaming channel <br>FIREAZZ GAMING​
    8·2 answers
  • Explain how loops can be utilized in list processing. Please provide Python examples in your response.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!