Ajout TPS + Entrainements
This commit is contained in:
18
DEV1.1/TP27/test.c
Normal file
18
DEV1.1/TP27/test.c
Normal file
@@ -0,0 +1,18 @@
|
||||
# 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;
|
||||
}
|
Reference in New Issue
Block a user