You are here:

C/fibunachi...

Advertisement


Question
We were told to make a fibunachi and i didn't know what it is so the teacher made this out put:

Number of Elements?6(inputed by the user)
1 1 2 3 5 8

Number of Elements?8(inputed by the user)
1 1 2 3 5 8 13 21

it's basically adding the last two numbers.
so, how do i do it?
please help.

tnx
clyde,

Answer
First you must understand it mathematically and then only you can write a program for this.
So, once you have a good mathematical understanding of this problem, write it down in plain english and then write an algorithm (steps).
After that, it is very easy to program this.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.