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 does kinetic energy affect the stopping distance of a vehicle traveling at 30 mph compared to the same vehicle traveling at
Virty [35]
The overall kinetic energy of the 60mph car is greater than the overall kinetic energy of the 30mph car. Because of this, it takes a greater force to stop the faster car because it has greater amount of kinetic energy (aka the amount of force needed to overcome the momentum of the faster car is larger).
4 0
3 years ago
Match each logical function with its description. AND COUNTIF SUMIF IF tests for a certain condition and returns one of two valu
lakkis [162]
1. IF
2. AND
3. COUNTIF
4. SUMIF
4 0
4 years ago
The length of a pencil would most likely be measured in:
Nataliya [291]
The length of the pencil would most likely be measured in centimeters.
6 0
3 years ago
Read 2 more answers
please help no one is helping me on this one
Zigmanuir [339]

Answer:C

Explanation:

4 0
3 years ago
What is best for a busy student to do for better results in school?
vlada-n [284]

Answer:

Manage time and stress

Explanation:

This is obvious

4 0
3 years ago
Read 2 more answers
Other questions:
  • Under which menu option of a word processing program does a star appear
    8·1 answer
  • Technician A says that the push rod connects to a pivoting component mounted at the top of the cylinder head called the camshaft
    14·2 answers
  • Which is most harmful computer virus define​
    15·1 answer
  • HI GIVING BRAINLIEST Tyra used the software development life cycle to create a new game. She released it to her friends in order
    14·2 answers
  • When RadioButton objects are contained in a group box, the user can select only one of the radio buttons on the panel.
    12·1 answer
  • Tom's Art Supplies used to sell art supplies through mail order catalogs, but the company's order takers often had difficulty de
    9·1 answer
  • While doing research on the Internet, what kind of website should you avoid because the information may be biased?
    11·1 answer
  • Please create C program, the task is to implement a function edoublepowerx that has an input parameter x of floating-point value
    11·1 answer
  • 1 point
    5·2 answers
  • Vẽ sơ đồ DFD cho của hàng bán điện thoại ( Môn phân tích và thiết kế hệ thống thông tin)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!