UNKNOWN //************************************** // Name: Fibonacci Number Generator // Description:Generates however many Fibonacci numbers the user enters, separated by a space. nothing special but thought i would post it.. // By: Reece James // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //This code is copyrighted and has limited warranties. //Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.13818/lngWId.3/qx/vb/scripts/ShowCode.htm //for details. //************************************** #include <iostream> int main(){ int a, b, c, d, e, count; std::cout<<"Enter How Many Numbers You Would Like" <<" To Generate..\n>>>"; std::cin>>count; count -= 2; a = 1; std::cout<<a<<' '; b = a+a; std::cout<<b<<' '; for( int i = 0; i < count; ++i){ if( i < count){ c = a+b; std::cout<<c<<' '; } ++i; if( i < count){ d = b+c; std::cout<<d<<' '; } ++i; if( i < count){ e = c+d; std::cout<<e<<' '; a = d; b = e; } } return 0; }