![]() | ![]() | ![]() | 6.2 Fibonacci Series |
This program will probably use the for
loop.
The series starts with a zero(0) and a one(1). Each subsequent number is the sum of the previous two numbers.
So:
Number the first number in the series, the zero with a zero. With this numbering LCD(Fn,Fm) = F(LCD(n,m)).
Your program need to print the following:
Other requirements:
#define
for the initial number of robots
and the end point constants.
printf
format string of" %6d %6d\n"
Study areas:
for
statement. Hanly & Koffman page 220.
Kernighan p13 & p60.
Harbison p243-247.
printf()
function. Hanly & Koffman pages 48-50 and pages 598-600.
Kernighan p7, p11, & p153.
Harbison p366+.
Extra credit:
Make sure that your program run sand prints the twenty-first Fibonacci number. Mark your output with:
![]() | ![]() | ![]() | 6.2 Fibonacci Series |