We are tasked to display 100 numbers ranging between 1 -30 using the read_array function, find its mode using a different function and display the result using another one. Then, we have to use the same function to initialize a new integer array with same size (100) to random numbers but this time, the range has to be between 1 and 200. I will then have to use this range to find the 2 smallest number. There's more into the that but my only concern right now is what I am asking for. I'm a little clueless on how to go about it. Here's what I have:
//Function Prototypes
void read_array(int [], int);
void print_array (int [], int);
void sortRand (int[], int);
void Mode (int[], int);
void Two_smallest(int [], int, int*, int*,int*, int*); //Part2
void read_array(int nums[], int SIZE)
{
srand(time(0));
for (int i = 0; i < SIZE; i++)
{
nums[i] = (rand() % 30) + 1;
}
}
P.S. I am not getting the same sequence. My code generates different random numbers every time I run the program so that is not the issue.