Hello DesmondLee,
Starting at the top of your program:
You include "<iomanip>", but never use it although you could.
The use of the "#define"s is OK, but I would have written them as
constexpr size_t MAX{ 42 };
where you can think of "size_t" as another name for an "unsigned int".
It is best to avoid using "using namespace std". This
WILL get you in trouble some day. I found this is worth reading
http://www.lonecpluspluscoder.com/2012/09/22/i-dont-want-to-see-another-using-namespace-xxx-in-a-header-file-ever-again/ you can also do a search here to find more information.
The prototypes are OK.
The use of global variables should be avoided and it is giving you a problem with the program. More later.
The "main" function is missing some code. When you have a program that uses "rand()" it is best to seed the RNG at the beginning of main. There are several ways to write this code, but I prefer to use this
srand(static_cast<size_t>(time(0)));
. The "static_cast<size_t>()" is because "srand()" takes an unsigned int. "srand()" only needs to be done once. Usually done at the beginning of "main".
At the end of main just before the return I added this code to keep the console window open to see the output.
I will start with the "generate_number()" function first and the first problem. At the beginning of the file you defined "int rng[SIZE];". Inside the function you defined "int rng[SIZE];" again. this local variable overshadows the global variable and the function used the local variable. When the function ends so does the local variable, so the global variable never receives any numbers. You could either do away with the global variable and make the local variable "static" so it is not lost or do away with the local variable thus using the global variable.
Normally what i do is define the variables in main and pass them to the functions that need them. In your case the array "rng"would have to be passed to two functions. The array name "rng" may be simple to you, but you should use a better name that better describes what the variable is like: "generatedNumbers". It feels like now is the time to learn to use a more descriptive name than a cryptic name.
It is not the best idea to put the "srand()" in the function because it could be called more than once and it only needs to be done once. I have not looked into it, so it may work here, but a bad habit to get into.
The function "inputs()" appears to be OK although I have not properly tested it properly.
In your for loops you start with
for (int i =0
yet you not only defined "i" in the function, but as a global variable. You do not need to define a global variable or a local variable for "i" because the for loop defines a local variable for "i" which is lost when the for loop ends and the other local variable "i" and the global variable "i" are never used.
In the end I commented out some of the local variables defined in the functions like "i" and "rng" forcing the program to use the global variables except "i" and the program ran fine.
Hope that helps,
Andy