This question already has an answer here:
So I am working on a school project that contains 3 parts. For the first part, we have to work with an integer array containing 100 elements initialized to random numbers from 1 to 30 and find its mode(s). I was able to do that. However, I am having a hard time trying to figure out the second part, which is to initialize a new array of random numbers from 1 to 200 containing the same size using the same function.
void read_array(int nums[], int SIZE)
{
srand(time(0));
for (int i = 0; i < SIZE; i++)
{
nums[i] = (rand() % 30) + 1;
}
}
Aucun commentaire:
Enregistrer un commentaire