Thread: i keep getting errors in my code for Fibonacci but i have to do it a certain way.

  1. #1
    Registered User
    Join Date
    Nov 2014
    Posts
    3

    Angry i keep getting errors in my code for Fibonacci but i have to do it a certain way.

    ok so i have to use a while loop to print out a set of fibonacci number but the user has to be able to select the first 2 number to start with. the program will run right up to the part where the loop starts but then will do nothing. i am attaching a c file with this maybe someone can tell me why my loop wont work and print out the set of numbers. projectd.c

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Code:
    printf("%d", &third);
    I see no need for the "&" sign in the above line of code.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    Nov 2014
    Posts
    3
    ok thank you know i get an error saying i keep getting errors in my code for Fibonacci but i have to do it a certain way.-capture-png

    not really understanding i thought when i write third = second + first i declared it.

  4. #4
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Umm, you didn't write third, you wrote thri​d. See the difference?

  5. #5
    Registered User
    Join Date
    Nov 2014
    Posts
    3
    wow thanks its been a long day at work.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What is the errors in this code? please help
    By Ma'd Saeed in forum C++ Programming
    Replies: 3
    Last Post: 05-08-2014, 06:29 AM
  2. Help with errors on my code!
    By ashleyd in forum C++ Programming
    Replies: 7
    Last Post: 10-30-2011, 01:35 PM
  3. Looking for source code of Lagged Fibonacci generator
    By user_name_void in forum C Programming
    Replies: 5
    Last Post: 02-28-2010, 02:29 PM
  4. Error with Fibonacci code generation
    By xeon1989 in forum C++ Programming
    Replies: 5
    Last Post: 10-04-2009, 08:58 AM
  5. My Ansi C Fibonacci code stinks! obvious bug?
    By Hansie in forum C Programming
    Replies: 4
    Last Post: 05-23-2007, 12:29 AM

Tags for this Thread