why is this keep giving me same 2 numbers?
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdlib>
#include <windows.h>
using namespace std;
int generate(int,int);
int _tmain(int argc, _TCHAR* argv[])
{
int random[1000];
for(int n=0;n<1000;n++)
{
random[n]=generate(1,50);
cout << random[n] << endl;
}
system("pause");
return 0;
}
int generate(int min, int max)
{
srand(GetTickCount());
int random_integer;
int range=(max-min)+1;
random_integer = min+int(range*rand()/(RAND_MAX + 1.0));
return random_integer;
}