Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A3 - WAP to generate negative Fibonacci numbers Description: In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence

A3 - WAP to generate negative Fibonacci numbers

Description:

In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence 0, 1, -1, 2, -3, 5, -8, 13, -21, 34, -55, 89, -144 . . .

By definition, the first two numbers in the Fibonacci sequence are 0 and 1, each subsequent number is the subtraction of the previous two

Pr-requisites:-

Loops

Operators

Objective: -

To understand the concept of

Continuos looping.

If-else constructs

Inputs: -

A integer say 'N'

Sample execution: -

Test Case 1 :

user@emertxe] ./fibbonacci_series

Enter a number: -8

0 1 -1 2 -3 5 -8

Test Case 2:

Enter a number: -10

0 1 -1 2 -3 5 -8

Test Case 3:

Enter a number: -21

0 1 -1 2 -3 5 -8 13 -21

Test Case 4:

Enter a number: -13

0 1 -1 2 -3 5 -8 13

Test Case 4:

Enter a number: 13

Invalid input

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

Step: 3

blur-text-image

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions