DEV/DEV1.1/TP27/test.c
2024-12-10 12:52:05 +01:00

18 lines
353 B
C

# include <stdio.h>
# include <stdlib.h>
void affiche_tableau(double* t, int len) {
if (sizeof(double)*len == sizeof(double)) {
printf("%.2f\n", t[len-1]);
}
else {
printf("%.2lf, ", t[0]);
affiche_tableau(&t[1], len-1);
}
}
int main(void) {
double t[5] = {1.25, 47.80, 77.01, 54.23, 895.14};
affiche_tableau(t, 5);
return EXIT_SUCCESS;
}