how to generate fibonacci series (lesser than 100)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omran11
    New Member
    • May 2010
    • 4

    #1

    how to generate fibonacci series (lesser than 100)

    how to generate fibonacci series (lesser than 100)
  • donbock
    Recognized Expert Top Contributor
    • Mar 2008
    • 2427

    #2
    Please recap for us what equations define the Fibonacci Series.

    Do you seek to print the first 100 terms of the series; or do you wish to print the series up to the first term that is greater than 100?

    Comment

    • Dheeraj Joshi
      Recognized Expert Top Contributor
      • Jul 2009
      • 1129

      #3
      Use golden ratio to generate the Fibonacci numbers.

      This may help you

      Regards
      Dheeraj Joshi

      Comment

      • donbock
        Recognized Expert Top Contributor
        • Mar 2008
        • 2427

        #4
        The OP may need help getting a C/C++ program to do his bidding but he ought to be able to describe what the program should do (in this case, the Fibonacci Series). Laying out the necessary equations fully and methodically often suggests a good structure for the program.

        Comment

        • Dheeraj Joshi
          Recognized Expert Top Contributor
          • Jul 2009
          • 1129

          #5
          I was confused whether OP wanted us, to write the program for him or he is asking for design help? Its hard to figure it out through this question. :)

          Regards
          Dheeraj Joshi

          Comment

          • omran11
            New Member
            • May 2010
            • 4

            #6
            no its like this
            write a program to generate Fibonacci series (Lesser than a limit):
            Enter Limit: 100
            0 1 1 2 3 5 8 13……..89

            Comment

            • Dheeraj Joshi
              Recognized Expert Top Contributor
              • Jul 2009
              • 1129

              #7
              Have you written code for this?

              Regards
              Dheeraj Joshi

              Comment

              • donbock
                Recognized Expert Top Contributor
                • Mar 2008
                • 2427

                #8
                omran11: You provided example output, but what are the equations that define the Fibonacci Series? I'm asking for the mathematical equations -- nothing to do with computer programs yet.

                Comment

                • omran11
                  New Member
                  • May 2010
                  • 4

                  #9
                  i want to display the outputs using while loop from 0 to 89 only

                  Comment

                  • donbock
                    Recognized Expert Top Contributor
                    • Mar 2008
                    • 2427

                    #10
                    No. You want to display the Fibonacci Series up to, but not including, the first term that is greater than 100. It just so happens that this means the last term displayed will be 89, but that magic number should not be hard-coded into your program. To include that number in your program requires you to solve the problem (to discover "89") before you write a program to solve the problem.

                    By the way, you haven't provided the mathematical equations that define a Fibonacci Series.

                    Comment

                    • whodgson
                      Contributor
                      • Jan 2007
                      • 542

                      #11
                      The second last integer you show in the series is 13. how is this arrived at? From this answer you can derive the mathematics of the series.

                      Comment

                      Working...