I have a 2 dimensional array. I need to use the rand() function to initialize the array with random numbers in between 10 and 75. This is what I have so far. I know this is incorrect, how do I tell it that I want the random numbers to be in between 10 and 75?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
usingnamespace std;
int table[10][5];
int row = 0;
int col = 0;
int main()
{
for (row = 0; row < 10; row++)
{
for (col = 0; col < 5; col++)
{
table[row][col] = rand();
cout << table[row][col] << endl;
}
}
}