C# Fibonacci Dizisi

     Bu yazıda sizlere C# üzerinde nasıl Fibonacci Sayı Dizisi oluşturacağımızı göstereceğim.Console uygulaması üzerinde yaptım.Dilerseniz diğer uygulamalarınıza da uyarlayabilirsiniz.

   Burada dizinin 10001'e(10001 dahil) kadar olan elemanları sıra ile ekrana basıyor.Takdir edersiniz ki bir süre sonra değişken sınırlarını taşıyor.Siz istediğiniz aralığa göre değişken türünü değiştirirsiniz.

//@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();
}
}
}
view raw .cs hosted with ❤ by GitHub
   

Yorumlar

  1. snow peak titanium - TI3
    Snow Peak Titanium titanium engagement rings is citizen titanium watch a small piece of titanium wood stove equipment produced by titanium rings the Solingen company. The parts are from mechanical parts from a Solingen titanium camping cookware workshop.

    YanıtlaSil

Yorum Gönder

Bu blogdaki popüler yayınlar

Kali Linux ve Debian Usb Kurulumundaki Cd Sorunu Çözümü