आपकी ऑफलाइन सहायता

BACK
49

सी प्रोग्रामिंग

149

पाइथन प्रोग्रामिंग

49

सी प्लस प्लस

99

जावा प्रोग्रामिंग

149

जावास्क्रिप्ट

49

एंगुलर जे.एस.

69

पी.एच.पी.
माय एस.क्यू.एल.

99

एस.क्यू.एल.

Free

एच.टी.एम.एल.

99

सी.एस.एस.

149

आर प्रोग्रामिंग

39

जे.एस.पी.





डाउनलोड पी.डी.एफ. ई-बुक्स
C++ - Fibonacci Series

विवरण :

कोई विवरण नहीं है |


सोर्स कोड :

#include
#include
using namespace std;

int main()
{
int n, i, first = 0, second = 1, next;

cout << "Enter the number of terms" << endl;
cin >> n;

cout << "Fibonacci series are " << endl;
for (i = 0 ; i < n ; i++)
{
if (i <= 1)
next = i;
else
{
next = first + second;
first = second;
second = next;
}
cout <

आउटपुट :

Enter the number of terms
5
Fibonacci series are
0
1
1
2
3