This commit is contained in:
2023-02-08 11:18:16 +01:00
parent 639fd8c410
commit 7021891e9c
60 changed files with 1218 additions and 0 deletions

0
DEV1.1S/TPREC/exo2.c Normal file
View File

13
DEV1.1S/TPREC/fibonacci.c Normal file
View File

@@ -0,0 +1,13 @@
#include <stdio.h>
#include <stdlib.h>
int fib(int n) {
if (n > 1) return n + fib(n-1);
else if (n == 1) return 1;
else return 0;
}
int main(void) {
fib(15);
return EXIT_SUCCESS;
}

17
DEV1.1S/TPREC/tableau.c Normal file
View File

@@ -0,0 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
void printTable(double* t, int n) {
if (n > 0) {
printf("%.5lf", *t);
if (n > 1) printf(", ");
printTable(t+1, n-1);
} else puts("");
}
int main(void) {
double t[5] = {1.72, 5.28, 9.025, 36.14, 3.14159};
printTable(t, 5);
return EXIT_SUCCESS;
}