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 =)
I have no idea how you would solve this using a nestedfor 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.