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()
{
You initialize the pseudorandom generator using the current time. On most platforms the time function returns the current time in seconds. If you run this program multiple times in a single second then you will set the same seed in all executions, and get the same "random" number.
Add e.g. a sleep 1 in the loop in the script and you will see a different result.