Construct an algorithm to print the first 20 numbers in the Fibonacci series (in mathematics) thanks
1 answer:
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
Answer:
i think its the second one
Explanation:
brainliest pls
A. Turning luxuries into necessaties
Answer:
What does your digital footprint say about you?
Explanation:
Just follow the path from the end to the start, that's how I always get mazes.
Answer: Internet service provider
Explanation:
Answer:
Answer is A. One.
Refer below.
Explanation:
A data flow cannot go directly back to the same process it leaves. There must be at least one other process that handle(s) the data flow, produce(s) some other data flow, and return(s) the original data flow to the beginning process.