Computer Science Canada

Need help in number sequencing...

Author:  chocolate thunda [ Thu May 13, 2004 7:54 pm ]
Post subject:  Need help in number sequencing...

My teacher asked me to create a program that puts numbers in this sequence up to 20 digits:
1,1,2,3,5,8,13...
You basically add the two previous number to get the third one.
I have tried for hours but was unnable to create the program, I was wandering if there is someone smart enough to help me...

Thank You Wink

Author:  omni [ Thu May 13, 2004 8:08 pm ]
Post subject: 

why don't you post an attempt of your code, or attach it as a file so then people will know what part of your program that you need help on. No one is going to do the programming for you.

Author:  chocolate thunda [ Thu May 13, 2004 8:25 pm ]
Post subject: 

What I tried goes something like this:

var s:int
put "Enter the number that you want to go up to:"
get s
put s

...this is the part where I don't know what to do.
I have no idea how to add the two previous numbers to get to the third one... and go on for up tp 20 digits.
This is where I need someone to help me. Sad

Author:  s_climax [ Thu May 13, 2004 8:26 pm ]
Post subject: 

http://www.compsci.ca/v2/viewtopic.php?t=4944

Author:  chocolate thunda [ Thu May 13, 2004 8:28 pm ]
Post subject: 

I already saw that and it doesn't work


: