for (Dest = N-1; Dest > 0; Dest--) { Src = rand() % (Dest+1); // Positions from [0] to [Dest] Swap (X[Src], X[Dest]); }