Bonjour a tous

Pourquoi dans ce code il tri correctement sauf le 1er chiffre?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
void ordonnerTableau(long tableau[], long tailleTableau);
 
int main(int argc, char *argv[])
{
    long tableau[10] = {2, 4, 3, 1, 15, 6, 9, 16, 19, 12};
    long i = 0;
 
    ordonnerTableau(tableau, 10);
 
    for(i = 0; i < 10; i++)
    {
        printf("%ld\n", tableau[i]);
    }
 
    return 0;
}
 
 
void ordonnerTableau(long tableau[], long tailleTableau)
{
    long i, a = 0;
 
     for(i = 0; i < tailleTableau-1; i++)
        {
            if(tableau[i] > tableau[i+1])
            {
                a = tableau[i+1];
                tableau[i+1] = tableau[i];
                tableau[i] = a;
                i = 0;
            }
        }
 
}
résultat :

2
1
3
4
6
9
12
15
16
19