DEV_BUT1/DEV1.1S/TPREC/tableau.c

17 lines
330 B
C
Raw Normal View History

2023-02-08 11:18:16 +01:00
#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;
}