Program to print Fibonacci series

0 Suresh Chand April 2, 2021

In this example, You will learn to write a program to print Fibonacci series using the C++ programming language. We will learn with a detailed explanation.

#include <iostream>
using namespace std;

int main()

    int num, i, nextTerm, t1=0, t2=1;
    cout << "Enter the number of terms: " << endl;
    cin >> num;

    for (i = 1; i <= num; ++i) {
        cout << t1 << "\t";
        nextTerm = t1 + t2;
        t1 = t2;
        t2 = nextTerm;

    return 0;


Notify of
Inline Feedbacks
View all comments

Join Our Newsletter Now

Get the latest tutorials, examples and projects updates.



Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Disable Ad Block

Want Same System