ok not that i like the fact that you didnt check the FAQ to begin with, but this isnt really in the faq, it just takes a little thinking, here is a sample of what your code should look like, i commented almost everything to show you what is happening thoughout the program.
Code:
#include <time.h>
#include <stdlib.h>
#include <iostream.h>
int main()
{
int i, j, k; //some variables
srand(time(NULL)); //sets a random seed for a random seed.
//this will allow us to get a random number 3 times
k=rand() %1000; //sets a number between 0 and 1000. (used later)
for(i=0; i<3; i++){ //simple for statment notice that 'k' is not included here
//although it could be, its included at the bottom. also
//notice that k gets increased by one each time.
srand(k); //this sets the random seed for our numbers. sence
//k it self is a random number, when the program is run
//more than once it will be changed every time and
//sence k gets higher by 1 each time, the seed is
//never the same.
j=rand() % 100; //now that we have our truly random seed we can
//make random numbers this will give a number between
//0-100.
cout<<j<<endl;
k++; //k gets increased by one for the next time its used for
//a random seed
}
}
if k wernt a random number it self k would end up being 1,2, or 3 and spit out the same numbers. sence it got increased by 1 each time. sence k IS a random number and has a fairly high field (0-1000), it will be random number such as 592 then the seed would change to 1+ the random number making it 593 then add another 1 to it making it 594 and so on.