CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    Jun 2011
    Posts
    5

    Lucas/Fibonacci sequence HELP please!!

    I am having trouble with my following code in which I have to write a program that allows the user to request a Lucas number (similar to Fibonacci sequence) and then my program is supposed to output that requested Lucas number & the calculated Lucas number.
    **However, my problem is that my program is only outputting the requested # and instead of calculating the Lucas number, the Lucas number is always 0!! So, I'm figuring that I have an error in my Lucas code. If someone has any suggestions......I've been working on this code for days & I'm sure it's a simple mistake?!

    *I have to write one static method in addition to main
    *Use loops to solve the Lucas number series
    *Use the double data type to process large Lucas numbers.

    ----I think I have most of that, however it will not calculate the Lucas number correctly for some reason?? PPPppplease help!!
    Attached Files Attached Files

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