#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int a = 1;
int b = 1;
int c;
if (a < 10) {
a + b == c;
a = c;
cout << ""<< c <<"\n";
a + b == c;
b = c;
cout << ""<< c <<"\n";
}
system("PAUSE");
}
This should give me the Fibonacci sequence, but it doesn't.
(1) + (1) = 2
then I make "a" = "c" so now its
(2) + (1) = 3
then I make "b" = "c" so then it should continue to do this
(2)+(3) = c
etc.
but it doesn't work... help?
hopefully bumps are legal... if not.. I appolgize
This post has been edited by 100100001101001: 03 June 2009 - 11:35 AM

New Topic/Question
Reply




MultiQuote








|