Non-recursive fibonacci

Assignment Help Business Management
Reference no: EM131289933

Non-recursive Fibonacci

The Fibonacci sequence is 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...

(The first term is 1. The second term is 1. Each term thereafter is the sum of the previous two terms.)

Write a C program that contains a function called fibonacci. This function, when given an integer n >= 1, will return the nth Fibonacci number. The function should use a non-recursive,iterative strategy. The main function should provide the user with a menu of two choices:

1- Calculate Fibonacci

2- Exit

(Enter 1 or 2)

If the user enters a choice different from 1 or 2, your program should detect the invalid choice,and re-prompt the user to enter a new valid choice. If the user picks choice 1, your program should prompt him/her to enter an integer number greater than 0. This number is first validated by the program, than function fibonacci is called, and the result is displayed to the user.The menu is continually displayed until Choice 2 is entered by the user. Use a switch statement for controlling the menu.

Reference no: EM131289933

Questions Cloud

What factors have contributed to life is good brand image : What are people buying when they purchase a Life is good product?- What factors have contributed to the Life is good brand image?
Does this enhance or diminish the investor''s return on stock : During the year, the pound appreciates against the yen. Does this enhance or diminish the investor's return on the stock?
Describe the organization hosting the award competition : Describe the organization hosting the award competition, the criteria for selecting winners, and one of the award-winning packages.
Explain applications of the cartesian coordinate system : Describe applications of the Cartesian coordinate system to plot a real-world situation. In your description, indicate the characteristics of each coordinate, and a point in terms of specific x and y coordinates.
Non-recursive fibonacci : Write a C program that contains a function called fibonacci. This function, when given an integer n >= 1, will return the nth Fibonacci number. The function should use a non-recursive,iterative strategy. The main function should provide the user w..
Suggest ways automobile makers can use social media : Suggest ways automobile makers can use social media through new digital devices in today's cars to safely create customer engagement and customermanaged relationships.
Calculate the sample size for the mean or sample : Calculate the sample size for the mean or sample or sample size for the proportion, using a 95% confidence level, estimated population standard deviation or estimate of the true population proportion, and a 5% margin of error.
Eliminate its exchange rate exposure : A manager in the U.S. firm reasons that because the dollar buys fewer yen on the forward market than it does on the spot market, the firm should not enter a forward hedge to eliminate its exchange rate exposure. Comment on this opinion.
Risks and internal controls for a french bank : In 8-10 double-spaced pages, each student analyzes the policies, vulnerabilities, risks and internal controls for a French bank that was a victim of a large scale fraud and recommends improvements to the company's IT security policies.

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd