DEV/DEV1.1/TP14/tableau.c

24 lines
346 B
C
Raw Normal View History

2022-12-14 15:29:55 +01:00
#include <stdio.h>
#include <stdlib.h>
void pTab(double tablax[],int i)
{
if (i>=0)
{
if (i==0)
{
printf("%.2lf\n", tablax[i]);
}else
{
printf("%.2lf ,", tablax[i]);
pTab(tablax,i-1);
}
}
}
int main(int argc, char const *argv[])
{
double tablo[5]={1,2,3,4,5};
pTab(tablo,(sizeof(tablo)/sizeof(tablo[0]))-1);
return 0;
}