Created
October 3, 2015 13:58
-
-
Save cagataycali/51ca228c226685cf8b21 to your computer and use it in GitHub Desktop.
Fibonacci sayılarını ekrana yazar
This file contains hidden or 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
/* Fibonacci sayilarini ekrana yazar */ | |
#include<stdio.h>int main( void ) | |
{ | |
int a = 0; /* a[n] */ | |
int b = 1; /* a[n+1] */ | |
int c; /* a[n+2] */ | |
int n; | |
int i; | |
printf("Fibonacci serisi kacinci elemana kadar yazilsin> "); | |
scanf("%d", &n); | |
for( i = 1; i <= n ; i++ ) { | |
printf( "%4d. Eleman: %d\n", i, a ); | |
c = a + b; | |
a = b; | |
b = c; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment