DEV/DEV1.1/TP06/mirroir.c

28 lines
370 B
C
Raw Normal View History

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