Kullanıcıdan girilen sayı kadar fibonacci dizisi oluşturan c kodları

07:10 0 Comments

#include <stdio.h>
#include <conio.h>



void main() {

// Girilen sayıya kadar olan fibonacci dizisi

int sayi,x=0,y=1,degisken;
int toplam = 0;
printf("Lürfen bir sayı giriniz");
scanf_s("%d", &sayi);

printf("Fibonacci dizisi baslıyor %d %d " , x, y);

for (int i = 1; i <= sayi; i++){

printf(" %d", (x+y));

degisken = x;
x = y;
y = degisken + y;





}



_getch();

}

erdem

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 yorum: