So I am trying to generate 10,000 random numbers from 1-100, but it is only generating up to 99 numbers because when I display it I can only see from 1-99, unless it is my code for finding it. Here is my code:
vector<int> vint;
for (int i = 0; i < 10000; i++)
{
int x = (rand() % 100) + 1;
vint.push_back(x);
}
frequency(vint);
void frequency (vector<int> v1)
{
int counter = 1;
int max = 0;
int mode = v1[0];
int numbercheck = 0;
for (int pass = 0; pass < 10000-1 ; pass++)
{
if (v1[pass] == v1[pass + 1])
{
counter++;
numbercheck++;
}
else
{
cout << v1[pass] << ": " << counter << "..................." << endl;
counter = 1;
}
}
