Searching...

Generate a Fibonacci series in C++ Programming?

15:23

#include <iostream>
using namespace std;
int main()
{
int i, a=0,b=1,c, num;
cout << "Enter Number for how many times generate Series: ";
cin >>num;
cout << "Fibonaci Series is: \n";
for(i=0;i<num;i++)
{
c=a+b;
a=b;
   b=c;
cout << "\t" <<c<<endl;
}
return 0;
}

0 comments:

Post a Comment

Thanks For Your FeedBack....

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.