You are calling srand
from inside of your loop. Each time you call it, you are setting the seed that is used to generate random numbers.
Move it outside of your loop as such:
srand(3);
for(a=0, a<10; a++){
int sleep = (rand() % 400) + 500;
}
Additionally, each time you run your program, it will generate the same sequence of numbers. If you wish to avoid that, you'll need to pick a different seed for each run. Typically this is a number that changes each time, such as time of day in seconds or something more unique.
srand((unsigned int)time(NULL));