One easy way to get a different sequence each time the program is run is to set the seed to the clock. Different C compilers have different ways of setting the seed so you will have to consult your documentation.