I have a C code file (call \"test.c\" and output is \"test.out\") like below and just a simple output of random number:
int main()
{
for i in 1 2 3 4 5
do
test.out
done
You execute the program 5 times in the same second, and since you are using system time in seconds as seed for your rand() function, naturally, you will get the same results. If you wait a second (or longer then a second) between executions, you will get different values.