From cd1458b139992e08a28ee85a9f1322dc91790900 Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Tue, 28 Mar 2023 10:22:28 +0200 Subject: [PATCH] Implement Fibbonachi Functionality --- Program.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Program.cs diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..9e4cce3 --- /dev/null +++ b/Program.cs @@ -0,0 +1,24 @@ + +int amount; + +ASK_INPUT: +Console.WriteLine("Enter how many numbers you want to compute:"); +string input = Console.ReadLine(); + +if(!Int32.TryParse(input, out amount)){ + Console.WriteLine("Input Wasn't a Number!"); + goto ASK_INPUT; +} + +// Declare Variables used for Calculation +System.Numerics.BigInteger themp; +System.Numerics.BigInteger a = 1; +System.Numerics.BigInteger b = 1; + +for (int i = 1; i < amount + 1; i++) +{ + Console.WriteLine($"{i}: {a}\n"); + themp = a; + a = a + b; + b = themp; +}