You can find quality tech news,tricks,study materials etc contact me:facebook.com/ashwin.sunilkumar
Support Me...........
Please support me by giving donation
contact: aswinavofficial@gmail.com
Total Pageviews
Monday, September 1, 2014
C++ program to genetate Fibonacci number series
/** Program to generate Fibonacci number series */
#include
using namespace std;
int main() {
cout << "Program to generate fibonacci series \n" << endl;
cout << "How many fibonacci numbers do you want? ";
int n; cin >> n;
int x=0, y=1, t=0;
while (n>0) {
t = x+y;
x = y;
y = t;
cout << y << " ";
n--;
}
return 0;
}
// aiuto
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment