for ( Src = 0; Src < N; Src++ ) { Dest = rand() % N; // All N positions equally likely Swap (X[Src], X[Dest]); }