Developpement/23DEV1.1/TPS1/TP2/22-Recursive/Tableau.c

24 lines
343 B
C
Raw Permalink Normal View History

2024-12-09 11:53:11 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void tableau(double tab[5], int d)
{
int num = d;
printf("%lf", tab[num]);
if(num<4){
printf(", ");
tableau(tab, num+1);
}else{
printf("\n");
}
}
int main(int argc, char const *argv[])
{
double tab[5] = {1.25, 47.80, 77.01, 54.23, 895.14};
tableau(tab, 0);
return 0;
}