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
Misha Larkins [42]
3 years ago
9

Construct an algorithm to print the first 20 numbers in the Fibonacci series (in mathematics) thanks

Computers and Technology
1 answer:
ss7ja [257]3 years ago
8 0

Answer:

0+1=1

1+1=2

1+2=3

2+3=5

3+5=8

5+8=13

Explanation:

// C++ program to print

// first n Fibonacci numbers

#include <bits/stdc++.h>

using namespace std;

 

// Function to print

// first n Fibonacci Numbers

void printFibonacciNumbers(int n)

{

   int f1 = 0, f2 = 1, i;

 

   if (n < 1)

       return;

   cout << f1 << " ";

   for (i = 1; i < n; i++) {

       cout << f2 << " ";

       int next = f1 + f2;

       f1 = f2;

       f2 = next;

   }

}

 

// Driver Code

int main()

{

   printFibonacciNumbers(7);

   return 0;

}

 

You might be interested in
How many micro processors will a small computer have? A. none B. two C. one D. three
kifflom [539]

Answer:

letter C

They only have one chip with two complete microprocessors on it, both of them share one path to memory and peripherals.

3 0
3 years ago
Read 2 more answers
You use the same five shell functions every day and are looking for a way to ensure they are available as soon as you log into y
ANTONII [103]

Answer:

.c. Load them via your login script.

Explanation:

Given that using functions in shell scripts enhances programming output and login script comprises the functions and statements required to effectively execute at any given time the user logs into their account.

Hence the moment these functions are formulated, they are then executed through a single command statement thereby reducing the time of re-writing another set of code repeatedly in every program.

Therefore, in this case, what you can do is to "Load them via your login script."

4 0
3 years ago
True or false A timeline can be used to demonstrate cause and effect relationships.
7nadin3 [17]
A timeline could be used to ssee the effect that relationships have on a person 
4 0
4 years ago
Read 2 more answers
What is wrong with each of the following code segments? int[] values; for (int i = 0; i &lt; values.length; i++) { values[i] = i
tino4ka555 [31]

Answer:

values have been declared but not initialized nor allocated memory. So you are not allowed to use "values.length"

7 0
3 years ago
PLS HELPPPPP ILL REALLY APPRECIATE IT!!
lyudmila [28]

<em>Answer:</em>

<em>The first option.</em>

3 0
3 years ago
Other questions:
  • Database designers typically do not add spaces in field names (LName), but can add details in the ________ field of the field pr
    9·1 answer
  • What cell address indicates the intersection of the first row and the first column in a worksheet?
    15·2 answers
  • Which hypervisor works on older pcs without hardware virtualization support?
    9·2 answers
  • List three things that scientists learned about earth beginning in the 1800s
    13·1 answer
  • Consider the classes below:
    13·1 answer
  • Intel Centrino Technology is the combinatin of wirelesstechnology with the previous HT technology.
    14·1 answer
  • _KOH + _Cu(CIO3)2 - __KCIO3 +<br>_Cu(OH)2​
    12·1 answer
  • Should-the-government-allow-illegal-immigrants-to-become-citizens
    12·1 answer
  • PI
    12·1 answer
  • there is a structure called employee that holds information like employee code, name, date of joining. Write a program to create
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!