This repository has been archived on 2019-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
s4-c/TP4/E5.c
2016-03-23 11:51:59 +01:00

23 lines
485 B
C

/* Recherche de la valeur minimale */
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[]) {
int T[] = {90, 23, 34, 10, 56, 67, 78, 89, 12};
int deb = 0;
int fin = 8;
int *P, *minI = T + deb, min = *(minI);
for (P = T + deb; P <= T + fin; P++) {
if (*P < min) {
min = *P;
minI = P;
}
}
printf("La valeur minimum est %d et est à l'indice %d.\n", min, minI-T);
return 0;
}