Ask your own question, for FREE!
Mathematics 17 Online
OpenStudy (anonymous):

Okay does ne1 know how to do fibbonaci series in C++ can anyone explain me the logics behind them need desperate help !!!!

OpenStudy (anonymous):

This is the definition of the Fibonacci Sequence. \[F_0 = 0, F_1 = 1\]\[F_{n+2} = F_{n+1}+F_n, n \geq2\]

OpenStudy (anonymous):

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.

OpenStudy (anonymous):

hoping u know C++

OpenStudy (anonymous):

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++ =/

OpenStudy (anonymous):

what are you asking... what those terms mean?

OpenStudy (anonymous):

or which one is fibbonaci

OpenStudy (anonymous):

it looks like he's doing a project in C++ where he has to code the F. Sequence.

OpenStudy (anonymous):

the fibbonaci is A AB ABC

OpenStudy (anonymous):

...or maybe not? now im a little lost.

OpenStudy (anonymous):

oh you are trying to create a code for fibbonaci's sequence

OpenStudy (anonymous):

yes!!!!!!!!

OpenStudy (anonymous):

he's trying to create a C++ code to show what fibbonaci sequence is doing

OpenStudy (anonymous):

do you have a way to create some sort of string?

OpenStudy (anonymous):

no i got this code from a friend i want to know how would it execute!!!

OpenStudy (anonymous):

...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'

OpenStudy (anonymous):

hey outcast do u know C++

OpenStudy (anonymous):

not really i've done a little coding

OpenStudy (anonymous):

then its going to cycle through values of i until i is bigger than a, then it will stop? i dont know >.<

OpenStudy (anonymous):

yes joe but ow does it WORK????

OpenStudy (anonymous):

joe math is correct he's asking for n and storing it as A

OpenStudy (anonymous):

for(i=1i<=a) is basically counting by integers

OpenStudy (anonymous):

all the wya to anything <= a

OpenStudy (anonymous):

and then i++

OpenStudy (anonymous):

so basically do you understand for statemtns?

OpenStudy (anonymous):

it's a loop that continuously evaluates your expression until you hit a

OpenStudy (anonymous):

so you have for(initial expression, conditional statement, evaluation (i++)

OpenStudy (anonymous):

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

OpenStudy (anonymous):

however i always used if statements when using for statements

OpenStudy (anonymous):

it'd also help to not use word lol

OpenStudy (anonymous):

Notepad++

OpenStudy (anonymous):

as it will keep track of what is within brackets

OpenStudy (anonymous):

becaue technically this file would not run because he has syntax errors within it

OpenStudy (anonymous):

he's missing a bracket somewhere

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!