DEV/DEV1.1/tableaux.c
2024-10-14 13:54:43 +02:00

38 lines
602 B
C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main (void){
int tableau[10];
int i;
int x;
int a;
int plus_grand;
srand(time(NULL));
for (i = 0; i < 10; i++){
tableau[i] = (rand() &101 ) -50 ;
}
for (x = 0; x < 10; x++){
printf(" | ");
printf("%d", tableau[x]);
}
printf("\n");
for (a = 0; a < 10; a++){
if (tableau[a] > plus_grand){
plus_grand = tableau[a];
}
}
printf("le plus grand est : ");
printf("%d", plus_grand);
printf("\n");
return EXIT_SUCCESS;
}