given the first two numbers of the sequence , say (f1 and f2 ),N^th number fn,n>=3 of this sequence is given by : fn=fn-1+fn-2
thus f3 = f2+f1=1+1=2 , f4=a3+a2=2+1=3 , and so on.
the number determined this way is called Fibonacci number . Suppose f2=7 and f1=3
then f3=f2+f1=7+3=10 ; f4=f3+f2=10+7=15.
using this information , write a program that determine and output desired number of the Fibonacci sequence given first two numbers . (f1 and f2) of the sequence and desired number (n) of the Fibonacci sequence is interactively entered into the program by the user . your program should continue to allow user to find the N^th Fibonacci number given first two numbers if the response is positive . please make use of more than one function ( example get_input , cal_fib_sequence,display_result) to solve this problem .
@vitinho lolwut? How about an array instead of all those variables? And what's with the "random function" ? What is it; what does it do? And as for the end, do you even know what a Fibonacci sequence is? Try http://en.wikipedia.org/wiki/Fibonacci_sequence .