Thread: Fibonacci

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    7
    Oh I'm sorry, I wasn't asking anyone to do my homework...I was just hoping that someone would be able to guide me in the right direction...if someone else does my homework, then I don't really learn and I want to learn. My first question is how would I set a limit so that say, if I want a limit of 30, my output should be 1 1 2 3 5 8 13 21. I'm not exactly sure how to set it as.

    Code:
    int fib, fib1, fib2, fib3, fibn;
    
    cout << "Please enter an upper limit (1 or less to quit) \n" << endl;
    cin >> fibn;

  2. #2
    Registered User
    Join Date
    Nov 2011
    Posts
    7

    Fib

    Oh I'm sorry, I wasn't asking anyone to do my homework...I was just hoping that someone would be able to guide me in the right direction...if someone else does my homework, then I don't really learn and I want to learn. My first question is how would I set a limit so that say, if I want a limit of 30, my output should be 1 1 2 3 5 8 13 21. I'm not exactly sure how to set it as.

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    5
    I'm thinking using an array would be the easiest way for accessing the numbers so often in the same group. As for the max number I'm thinking a Do..While loop would work. I'm just a novice when it comes to C++ but from what I gathered that should work. I'm actually going to try and make this now just to see if I can. Thanks for the challenge.
    Last edited by Blade3575; 11-29-2011 at 07:57 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with a Fibonacci
    By Thedog in forum C Programming
    Replies: 3
    Last Post: 01-17-2011, 06:04 PM
  2. Fibonacci
    By Paged in forum C Programming
    Replies: 2
    Last Post: 12-22-2010, 04:42 PM
  3. nth fibonacci
    By meriororen in forum C Programming
    Replies: 1
    Last Post: 08-10-2009, 05:13 AM
  4. sum of fibonacci
    By bazzano in forum C Programming
    Replies: 2
    Last Post: 08-18-2005, 09:28 AM
  5. fibonacci(10,000)
    By blindman858 in forum C++ Programming
    Replies: 4
    Last Post: 05-20-2005, 12:03 AM