Hi so I'm trying to make a random number generator as part of my calculator. I have been learning C++ for the past few weeks and I'm not sure what the problem is. Codeblocks can detect no errors but it will not function correctly.
int first;
int last;
int counter;
cout << "Enter range of the numbers you want to generate. eg. Between 1 and 20.\n" << endl;
cout << "Between..." << endl;
cin >> first;
cout << "And..." << endl;
cin >> last;
cout << "Enter the amount of numbers you want to generate: " << endl;
cin >> counter;
cout << endl;
srand(time(0));
for (int first; last < counter; first++)
{
cout << 1+(rand()%last) << endl;
}