Developpement/23DEV1.1/TPS1/TP01/07-Boucles/BouclesBis/Progress.c

27 lines
458 B
C
Raw Normal View History

2024-12-09 11:53:11 +01:00
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int i = 0;
int one = 0;
int two = 1;
int three = 1;
while(i<20){
if (i<2){
if (i == 0){
printf("u%d = 0\n", i);
}else{
printf("u%d = 1\n", i);
}
}else{
one = two + three;
printf("u%d = %d\n", i, one);
two = one + three;
printf("u%d = %d\n", i, two);
three = one + two;
printf("u%d = %d\n", i, three);
}
i++;
}
return EXIT_SUCCESS;
}
/*1 1 2 3 5 8 13 */