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
Ryan wants to ensure that all the words in this document are evenly spaced so that they look neat and readable . Which option in
natka813 [3]
To achieved a document that is evenly spaced so that they look neat and readable, the option in a word processing program will help to achieve this is the home setting. In the home of the word, you can see there various tabs, one of the tabs is the paragraph. You will click symbol of "justify". And there is simple code to do that, just press the "Ctrl" and "J" on your keyboard at the same time.
5 0
3 years ago
even if we reach that state where an AI can behave as human does,how do we measure if AI is acting like a human?
xxTIMURxx [149]

A person can be able to measure if AI is acting like a human by the use of   Turing test.

<h3>How do we measure of artificial intelligence is acting like a human?</h3>

One can measure if AI is  Acting humanly via the use of a human who is said to interrogates the program and also the use of another person through the use of a terminal simultaneously.

Note that If after some amount of time or period, the interrogator is said to be unable to tell which is which, the program is said to have passed. To pass this test it is one that needs natural language processing.

Hence, A person can be able to measure if AI is acting like a human by the use of Turing test.

Learn more about AI from

brainly.com/question/25523571

#SPJ1

4 0
1 year ago
Before a program written in c can be executed on a computer, what step is required to be done first?
sergejj [24]
It should be compiled. It won't work if it's not compiled.
6 0
3 years ago
Use the drop-down menus to complete statements about archiving and backing up data fileArchiving data files manages the size of
svetoff [14.1K]

Answer:

Archiving data files manages the size of a mailbox for  

✔ local

storage.

Creating an Outlook data file  

✔ protects

data files in storage on a computer.

Explanation:

Because its right.

3 0
3 years ago
Read 2 more answers
A developer designed a process in UiPath Studio that is best-suited for a simple and linear process. Which Studio workflow type
Gala2k [10]

Question options:

State Machine

Flowchart

Sequence

Global Exception Handler

Answer:

Sequence

Explanation:

Uipath is an RPA(Robotic process automation) software that is used by IT professionals and business executives in automating routine or iterative tasks in an organization. Uipath process projects incorporate different workflow types which include :sequence, flowchart, state machine and global exception handler. The sequence workflow type is used for simple linear projects that are not very complex and occupies a single activity block.

3 0
3 years ago
Other questions:
  • An electronic resume is a plain-looking document. True of False?
    6·2 answers
  • 2. Now write a program named filereader.py that reads and displays the data in friends.txt. This program should also determine a
    5·1 answer
  • If i throw papers in the dryer to help them dry faster could that mess up the dryer?
    5·1 answer
  • 1. Which plot element is typically the turning point and the most intense moment of a story? (1 point)
    11·2 answers
  • If a tv was showing a flat black or blue screen or had "snow", what steps would you take to fix it? Give an example of the direc
    11·1 answer
  • When was kale discovered?
    9·1 answer
  • A character with the point size of 10 is about 10/72 of once inch in height
    8·1 answer
  • What are examples of Table Tools options that can help edit data?
    15·2 answers
  • You are a network administrator for your company. The network consists of a single Active Directory domain. All servers run Wind
    7·1 answer
  • Answer the following question in 3-4 complete sentences. Define the following terms: - registration - press - keyblock.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!