Code:
          for (i = 0; i < length; ++i)
          {
          
          num = GetRandNum(4);
          sequence += SYMBOLS[num]; 
          index1 = (rand() % 3);
          index2 = (rand() % 3);
          temp = sequence[index1];
          sequence[index1] = sequence[index2];
          sequence[index2] = temp;
          }
Remove all of the lines in red, as I dont know what its doing, but if you just need to append to sequence, then you dont need the red lines. Also, change the "4" to "3" in the GetRandNum call, if you have verified that 3 is correct (to generate from 0 to 3).