Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C programming: In mathematics, the Fibonacci numbers (in this case only positive numbers) are the numbers in the following integer sequence, called the Fibonacci

In C programming:

In mathematics, the Fibonacci numbers (in this case only positive numbers) are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones:

0 1 1 2 3 5 8 13 21 34 55 89 144 ... 

Write a function called fibonacci that takes two integers arguments and prints out in ascending order all fibonacci numbers between the first (or closest higher or equal) and the second argument (closest lower or equal). Your function must return the amount of fibonacci numbers printed out.

Example 1:

When the input is:

4 34 

The output is

5 8 13 21 34 

The function must return 5.

Example 2:

When the input is:

4 100 

The output is

5 8 13 21 34 55 89 

The function must return 7.

Requirements

Read the inputs from the user

Declare the prototype of your function before the main function

Call your function to do the printing based on the inputs from the user

Print a space after each number including the last one printed

#include

int main() {

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

Define judgment as a management function. LO.1

Answered: 1 week ago

Question

What was your favorite subject in school?

Answered: 1 week ago