random number

int main(void)
{
int i=0;
for(i=0;i<10;i++)
printf("%d\t",rand()%100);
while(!kbhit());
return 0;
}


it gives the same output everytime why?
man wrote:
The srand() function sets its argument as the seed for a new sequence of pseudo-random integers to be returned by rand(). These sequences are repeatable by calling srand() with the same seed value.

If no seed value is provided, the rand() function is automatically seeded with a value of 1.
Topic archived. No new replies allowed.