Problem with rand()
Posted: Thu Apr 21, 2005 3:13 pm
Hi,
I am running this in Microsoft Visual C++.
The problem is I am getting same set of values everytime I run ... what should I do to get different sets of value ?
Code: Select all
#include<stdio.h>
#include<stdlib.h>
main()
{
int i,j;
for(j=0;j<10;j++)
{
i = rand();
printf("\n%d",i);
}
}
The problem is I am getting same set of values everytime I run ... what should I do to get different sets of value ?