ok i read the FAQ on random numbers but couldnt make much sense of it, i am writing code for an assigments, which is to create a lottery program, here is the code i have so far:
Code:
#include "stdafx.h"
#include "time.h"
int lottery[6];
void main()
{
srand((unsigned)time(NULL));
lottery[0] = rand()%49;
lottery[1] = rand()%49;
lottery[2] = rand()%49;
lottery[3] = rand()%49;
lottery[4] = rand()%49;
lottery[5] = rand()%49;
printf("%d\t%d\t%d\t%d\t%d\t%d\n\n", lottery[0], lottery[1], lottery[2], lottery[3], lottery[4], lottery[5]);
system("pause");
}
can anyone help so i can create UNIQUE random numbers?