-
-
Save Euler29/10c4b5ff811b846e19f0dccad6fedb2a to your computer and use it in GitHub Desktop.
C# Fibonacci Number Sequence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@Euler29 on GitHub | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication2 | |
{ | |
class Fibonacci | |
{ | |
static void Main(string[] args) | |
{ | |
double a = 1; | |
double b = 1; | |
double c; | |
Console.WriteLine("1"); | |
Console.WriteLine("1"); | |
for (int i=1;i<=9999;i++) | |
{ | |
c = b; | |
b = b + a; | |
Console.WriteLine(b.ToString()); | |
a = c; | |
} | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment