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

  Government have an absolute prohibition on commercial access

The Federal government manages millions of acres of forest land across the country, but there are increasing pressures on the agencies to permit varying levels of commercial access to the timber, other resources, and the water flows. Should the go..

  Feasibility analysis for this proposed project

A business analyst working for a small business that is considering a project to implement a Customer Relationship Management (CRM) system for use by field sales personnel. The system will use the ACT! software application from Sage Software, Inc. Ma..

  Caesarean sections were seen by a consultant

There were 3 infant deaths classed as early neonatal. 86 of the caesarean sections were seen by a consultant. Using the above information, calculate the following:

  Determine your personal level of creativity.

You need to analyze yourself to determine your personal level of creativity. Your Personal Creativity Paper must:Assess your level of creativity. Be sure to support your assessment with examples. Explain the role of creativity in your profession. Be ..

  Capability to the local phone company

He has invented a device that attaches to both his phone line and through his computer to the Internet to block telemarketing calls without having to pay a service fee for the capability to the local phone company.

  Best forms of employee testingdetermine the types of

best forms of employee testingdetermine the types of employee testing that companies may require that are discussed

  Determine economic success in different time periods

A definition of the measures used to determine economic success in the different time periods -A link from each policy back to these distinctions and measures.

  Prepare a research paper that addresses cultures represented

Prepare research paper that addresses cultures represented by person above. The paper should be approximately five-six pages of text. Make sure you check your previous papers and do not make the same errors in this paper.

  Develop a guerrilla marketing strategy for your business

Develop a guerrilla marketing strategy for your small business. Discuss the most appropriate location for a second store (an actual street address). Explain your reasoning.

  Pestro is the manufacturer of a weed killer

Pestro is the manufacturer of a weed killer that is utilized in the parks in Metroville. After the parks were sprayed a group of children became ill as well as required hospitalization

  Develop the basic premise of your new company

You have decided to open a lemonade stand in your local neighborhood. You have grand plans for this stand and expect to attract many customers. In part I of this assignment, you will develop the basic premise of your new company. Please answer..

  Examples of economies and diseconomies of scale

Provide and discuss some examples of economies and diseconomies of scale in a college environment. Discuss some forecasting issues that you encounter in your daily life. How do you make your forecasts? Provide some examples of time series that exhibi..

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