Determining the value of a term in a series

hey, my teacher asks me to write a code that determines the value of the nth term ( the user will input the value of n ) in a series.
The series is called Fibonacci series, which is 1, 1, 2, 3, 5, 8, 13
(every term is the sum of the previos two terms)
Can anybody show me how can i make the code?
ps: this question is solved using the nested for function =)
Take a guess at how you'd do it, and get back to us with the code. :)

-Albatross

P.S.- The for loop will require you to read one element backwards, so make sure fib[0] and fib[1] are equal to one at the start of the program.
I have no idea how you would solve this using a nested for loop. A single for loop is all that you need. (Or a recursive function, but that has penalties.)

How is the Fibonacci series defined?
Your code will work similarly.

Give it a try and show us what you get.
Topic archived. No new replies allowed.