Need some help or advice in C++ program
I need just a little help with my program,program rans and it will display 10 different lotto numbers. However i raninto a problem, everytime i run it i get numbers that are the same in the draw. Can anyone give me some advice or help on how i can prevent that from happening. Can i do FOR statement to reset all to 0 or set array to 0? how would i go doing that? I included the program below. Thanks for the help
Code:
//sp
//11/30/04
#include <iostream>
using namespace std;
#include <iomanip>
using std::setw;
#include <cstdlib>
#include <ctime>
int main()
{
const int size = 6;
int a[size] = {0,0,0,0,0,0};
srand(time(0));
for(int w=1; w<11;w++){
cout <<"For game #"<< setw(3) << w << "=";
for(int i=0;i<size;i++){
a[i] = rand()%59 + 1;
cout << setw(5) << a[i] <<" ";
}
cout <<endl;
}
cout <<endl;
return 0;
}