Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void ordonnerTableau(int tableau[], int tailleTableau);
- int main(void)
- {
- int taille = 6, i;
- int tableau[6] = {10, 15 , 66 , 22 , 13, 58};
- ordonnerTableau(tableau, taille);
- for (i = 0; i < taille; i++)
- printf("%d%s", tableau[i], (i == taille-1) ? "." : ", ");
- return 0;
- }
- void ordonnerTableau(int tableau[], int tailleTableau)
- {
- int i,j,k,t;
- for (i = 0; i < tailleTableau; i++)
- for (j = 0; j < tailleTableau-1; j++)
- if(tableau[j] > tableau[j+1])
- {
- k = tableau[j];
- tableau[j] = tableau[j+1];
- tableau[j+1] = k;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement