text: rand()function isn't really random. If you keep repeating the program you will most likely see the same numbers. If you are saying that when iterating through six numbers the the random numbers are repeating then just call an if statement that gets a new random number if it is repeated.
  rand()function again. I'm pretty sure your if statement won't do anything but print out the numbers in the array.
  for (int x=0; x<50;x=x+1), change the
  x=x+1to
  x++.
  x++;or for example x-- means x=x+1 or x=x-1 respectively.
  #include <random>and using any of the pseudo-random number generators might help to output a more random number.
  count++until count is 6.