Skip to content

Instantly share code, notes, and snippets.

@Euler29
Last active July 4, 2017 08:18
Show Gist options
  • Save Euler29/10c4b5ff811b846e19f0dccad6fedb2a to your computer and use it in GitHub Desktop.
Save Euler29/10c4b5ff811b846e19f0dccad6fedb2a to your computer and use it in GitHub Desktop.
C# Fibonacci Number Sequence
//@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