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
Serga [27]
3 years ago
9

Write an application program in C++ to implement a class Fibonacci to print Fibonacci series upto N using member function series

() .
​

Computers and Technology
1 answer:
fiasKO [112]3 years ago
5 0

Answer:

Program approach:-

  • Using the header file.
  • Using the standard namespace I/O.
  • Define the main function.
  • Display the number of terms.
  • Display the Fibonacci series.
  • Print the first two numbers.

Explanation:

Program:-

//header file

#include <iostream>

//using namespace

using namespace std;

//main function

int main() {

   int n, s1 = 0, s2 = 1, nextTerm = 0;

//display the number of terms

   cout << "Enter the number of terms: ";

   cin >> n;

//display the Fibonacci series

   cout << "Fibonacci Series: ";

   for (int j = 1; j <= n; ++j) {

       // Prints the first two terms.

       if(j == 1) {

           cout << s1 << ", ";

           continue;

       }

       if(j == 2) {

           cout << s2 << ", ";

           continue;

       }

       nextTerm = s1 + s2;

       s1 = s2;

       s2 = nextTerm;

       

       cout << nextTerm << ", ";

   }

You might be interested in
When you ____ an exception, you send a message that an error has occurred to another part of the program.
jekas [21]
The correct answer is most definitely B
8 0
3 years ago
Read 2 more answers
When you connect to an Access database, which entities are shown in the Navigator window?
Leni [432]

1DFASDFAASDASDFASDFADSFASFD

4 0
2 years ago
Read 2 more answers
Question 15 of 25
GaryK [48]
It gains purchasing power. Less money in circulation = more value.
5 0
3 years ago
If you are going to attach more than 15 devices to your wireless network, you should make sure your router supports which standa
Westkost [7]

Answer:

802.11ac

Explanation:

It is a wireless networking standard.It functions only on 5 Ghz only. 802.11ac has three times the bandwidth of 802.11n hence it can handle more number of users.It has multi-link throughput of 1 gigabit per second.It provides high throughput.It is very useful for environments with high user density.

3 0
3 years ago
What would happen without satellites???
laila [671]

Answer: without satellites there would be no way for the world to communicate

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following statements about Linux is not​ true? A. Linux works on all the major hardware platforms. B. It plays a ma
    5·1 answer
  • Fill in the blank.
    7·1 answer
  • What is the order of adding 10.0 to each element in a one-dimensional array of N real numbers?
    13·1 answer
  • Which file type is typically used for videos? GIF MPEG MP3 PDF
    8·1 answer
  • What is structured​ knowledge?
    10·1 answer
  • After separating from Mexico, Texas passed laws that made it harder for slave owners to _____________ slaves.
    12·2 answers
  • Exercise#3: Write a ch program that performs the following: Declare a two arrays called arrayA and arrayB that holds integer and
    6·1 answer
  • (d) What other services beside cloud-based software may be provided by Internet hosts?[1]
    11·1 answer
  • Question # 2
    7·1 answer
  • What plugs into this?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!