DEV_BUT1/DEV1.1/TP05/fibo.c

19 lines
254 B
C

#include <stdio.h>
#include <stdlib.h>
int main(void){
int a=0;
int b=1;
int n;
int i;
int e;
printf("Donne une valeur :");
scanf("%d", &n);
for(i = 0; i <n ; i=i+1){
e = a+b;
printf("%d\n", e);
a = b;
b = e;
}
return EXIT_SUCCESS;
}