DEV/DEV1.1/TP16:Recursivite/tableau.c
2023-01-03 11:27:42 +01:00

22 lines
393 B
C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void afficheTabRec(double tab[],int taille){
if(taille==0){
return;
} afficheTabRec(tab, taille-1);
printf("%.2f, ",tab[taille-1]);
}
int main(){
int i;
double *tab = malloc(15 * sizeof (double));
srand(time(NULL));
for (i=0;i<15;i++){
tab[i]=(rand()%1000);
}
afficheTabRec(tab, sizeof(tab));
putchar('\n');
return 0;
}