Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- #include <time.h>
- #define NBMAX 10
- void init_alea_tab(int*t, int NB);
- void affiche_tab(int*t, int NB);
- int main() {
- SetConsoleOutputCP(1252);
- srand(clock());
- int tab[NBMAX];
- init_alea_tab(tab, NBMAX);
- affiche_tab(tab, NBMAX);
- printf("-------------------\n");
- //plus grande valeur
- printf("-------------------\n");
- //plus petite valeur
- printf("-------------------\n");
- //tri tab croissant
- printf("-------------------\n");
- //nb de valeur distinctes
- printf("-------------------\n");
- //nb de répétition des valeur
- system("PAUSE");
- return 0;
- }
- void init_alea_tab(int*t,int NB) {
- for (int i = 0; i < NB; i++) {
- t[i] = rand() % 101;
- }
- }
- void affiche_tab(int*t, int NB) {
- for (int i = 0; i < NBMAX; i++) {
- printf("Valeur %d : %d\n", i + 1, t[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement