DEV_BUT1/DEV1.1/TP05/fibo.c

19 lines
254 B
C
Raw Normal View History

2022-10-18 14:50:36 +02:00
#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;
}