Okay does ne1 know how to do fibbonaci series in C++ can anyone explain me the logics behind them need desperate help !!!!
This is the definition of the Fibonacci Sequence. \[F_0 = 0, F_1 = 1\]\[F_{n+2} = F_{n+1}+F_n, n \geq2\]
This is what we call a Linear Recurrence. The n-th term of the sequece depends on some linear combination of the terms before it.
hoping u know C++
Using the formula, for the next term we would get: \[F_2 = F_1+F_0 \iff F_2 = 1+0 = 1\] the next term would be: \[F_3 = F_2+F_1 \iff F_3 = 1+1 = 2\] so on and so forth. The sequence looks like: 0, 1, 1, 2, 3, 5, 8, 13, .... No i dont know C++ =/
what are you asking... what those terms mean?
or which one is fibbonaci
it looks like he's doing a project in C++ where he has to code the F. Sequence.
the fibbonaci is A AB ABC
...or maybe not? now im a little lost.
oh you are trying to create a code for fibbonaci's sequence
yes!!!!!!!!
he's trying to create a C++ code to show what fibbonaci sequence is doing
do you have a way to create some sort of string?
no i got this code from a friend i want to know how would it execute!!!
...i thnk that code might spit out the nth Fibonacci number? it looks like its going to ask you for a number, and store it in 'a'
hey outcast do u know C++
not really i've done a little coding
then its going to cycle through values of i until i is bigger than a, then it will stop? i dont know >.<
yes joe but ow does it WORK????
joe math is correct he's asking for n and storing it as A
for(i=1i<=a) is basically counting by integers
all the wya to anything <= a
and then i++
so basically do you understand for statemtns?
it's a loop that continuously evaluates your expression until you hit a
so you have for(initial expression, conditional statement, evaluation (i++)
if i was making a program for the Fib numbers, i would cheat and use the closed formula lol <.< recursion is for noobs! lolol jk
however i always used if statements when using for statements
it'd also help to not use word lol
Notepad++
as it will keep track of what is within brackets
becaue technically this file would not run because he has syntax errors within it
he's missing a bracket somewhere
Join our real-time social learning platform and learn together with your friends!