I need to generate 40 random numbers between 50 and 100 using rand(). How do I do this?
cout << sizeof(a) << endl;
for(int i = 0; i < 40; i++)
{
if(rand() % 1000+1 >= 50 && rand() %1000+1 <= 100)
a[i] = rand() %1000+1;
}
I was doing something like this, but it didn't work at all. : S