srand(time(0))
does not seem to be seeding rand()
correctly, the 1st number generated is always the same.
This is running on OS X, is there something wrong with my settings or my code? I do wait a couple of seconds to rerun the program. The 1st number increments only a day later, the rest of the numbers are always random.
#include<iostream>
using namespace std;
int main ()
{
int Num1,Num2;
// seed the random number generator
srand((unsigned int )time(NULL));
Num1 = rand() %49 +1 ;
do {Num2 = rand() % 49 + 1;}
while(Num2 == Num1);
///Display Random Numbers
cout<<"Numbers are: "<<endl;
cout<<Num1<<" "<<Num2<<endl<<endl;
return 0;
}