CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 1999
    Location
    Baytown, TX, United States
    Posts
    23

    HELP! Need For Next loop for Fibonacci!

    I need a For Next loop that will print the first 10 Fibonacci numbers1,1,2,3,5,8,13,21,34,55)

    kazooie21

  2. #2
    Join Date
    Oct 1999
    Location
    CA
    Posts
    91

    Re: HELP! Need For Next loop for Fibonacci!

    This was fun to write


    Dim i as Integer
    Dim X as Integer
    Dim Y as Integer
    Dim Z as Integer

    X = 0
    Y = 0
    Z = 1
    for i = 1 to 10
    Debug.print Z
    X = Y
    Y = Z
    Z = X + Y
    next




    Brewguru99

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured