I am making a program for a C++ class. I am wondering why my second output is only showing 18 outputs, when I need it to display 32. Can someone help?
I tried to include all of the code that I have, it is missing the top libraries.
#define max_value_num1 5
#define max_value_num2 6
#define max_value_num3 7
#define max_value_size1 25
#define max_value_size2 50
#define max_value_size3 250
using namespace std;
int main()
{
int num1, num2, num3;
// list our variables
srand(23);
num1 = 1 + (rand() % (25 - 1 + 1));
//RNG with a range of 1-25
cout << "First set of numbers: " << num1 << " values" << endl;
int i;
for (i = 1; i <= num1; i = i + 1)
// setting the conditions for the for loop
{
cout << setw(12) << right;
if (i % max_value_num1 == 1 and i > 0)
// making it display 5 per line
{
cout << endl;
}
cout << rand() << " ";
}
num2 = 1 + (rand() % ( max_value_size2 - 1 + 1));
cout << endl << endl << "Second set of numbers: " << num2 << "
values" << endl;
while ( i <= max_value_size2 )
{
i = i + 1;
cout << setw(12) << right;
cout << rand() << " ";
if (i % max_value_num2 == 0 and i > 0)
// making it display 6 per line
{
cout << endl;
}
}
return 0;
}