DEV/DEV1.1/TP06/remplissage.c

27 lines
392 B
C
Raw Normal View History

2022-10-12 16:41:20 +02:00
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void){
srand(time(0));
int tab[10];
int i;
for(i=0;i<10;i++){
tab[i]=(rand()%(50+1-(-50)))-50;
}
printf("+");
for(i=0;i<10;i++){
printf("-----+");
}
printf("\n");
for(i=0;i<10;i++){
printf("|%3d, ",tab[i]);
}
printf("|\n+");
for(i=0;i<10;i++){
printf("-----+");
}
printf("\n");
return EXIT_SUCCESS;
}