To be fair, if you are in a company as a programmer and they want you to implement the algorithm in the worst (for you) way, you implement it in the worst way. Simple as that. A requirement is a requirement. It is part of the job. If you want to change the requirements that is another story. The same is with the professor. If he specifically asks you to, why change it? If you want to change it ask him/her in advance.
The same with not using things that are not introduced in the class. Maybe the professor wants to teach you another way as well to do things. He should find an example that you wouldn't use things that are not introduced, but, hey, it is simpler just to restrict you. If he wanted to teach you how to read a line and split it with a delimiter using only getchar() and array manipulation then it would make no sense if you just used fgets() and strtok() instead, would it?
Eh, global variables maybe have a lot of downsides but that doesn't mean they shouldn't be used. Practically they can be used very safe with proper planning and naming. For example
Code:
int MyWhateverFunctionCounter = 1;
void MyWhateverFunction() {...}
You are using a global variable in one function, there is no real confusion or anything. The same for using one flag to synchronize threads etc etc.
Now, if you were to do things like
Code:
int result;
int main()
{
...
result = x * y;
AddToResult(100);
}
where AddToResult() updates the global variable result then you have a MESS.
But I would prefer instead of avoiding global variables like the plague to teach people about using them in one logic unit. Because you don't have classes in C to limit the scope of them doesn't mean that you cannot use them. You just have to assign them yourself on a logic unit (like 4 functions that are used for a single logical operation) and not use them out of that.
If you avoid something you never learn about it. There are some things that you can avoid entirely (like gets() or goto) but finding a way to avoid a global variable doesn't mean that your code will be better. It might as well become more complicated. You might as well waste time trying to find a workaround instead of focusing on more important parts.