(fibonacci)
using
System.Collections.Generic;
using
System.Text;
//CAFER KORKMAZ
//İSTENİLEB
FİBONECCİ SERİSİ ELEMANININ DEĞERİNİ BULAN PROGRAM
//23.03.2008
namespace
IsteSayFiboKar
{
class Program
{
static void Main(string[] args)
{
int
b, i;
int[] a = new Int32[100];
a[0] = 0; a[1] = 1;
Console.WriteLine("\n
fibonecci karşılığını istediğiniz sayısını giriniz");
b =
Convert.ToInt32(Console.ReadLine());
for (i = 2;i<=b; i++){
a[i] = a[i - 1] + a[i - 2];
}
Console.WriteLine("istediğiniz
sayının fibonecci karşılığı {0}'dır", a[b]);
Console.ReadLine();
}
}
}
Hiç yorum yok:
Yorum Gönder