You are on page 1of 3

Machine Problem 2: Prog22

Create a complete C# program that will find the nth Fibonacci number. Use the formulas in finding the
odd and even Fibonacci number.

PSEUDOCODE

BEGIN

DO

Prompt user to enter number

Save input to variable num

Convert num to double

IF num modulo 2 = 0

Fib = (1.618 raised to num) + (1.1618 raised to -num) / Square root of 5

PRINT fib

ELSE

Fib = (1.618 raised to num) - (1.1618 raised to -num) / Square root of 5

PRINT fib

ENDIF

IF rounded off fib modulo 2 == 0

PRINT fib is even

ELSE

PRINT fib is odd

ENDIF

Prompt user to try again

WHILE User input != "N"

ENDDO

END
FLOWCHART

You might also like