Quote Originally Posted by Scrogdor View Post
Nothing wrong about it. It does what it is supposed to do so the teacher that is grading our assignment can see the work in action. We do as he directs, not as we want.
There are a couple things wrong with it. Not only are they bad practices that should be corrected early, they result in undefined behavior. Anything or nothing at all can happen. That means they might not crash, or might only crash on the 3rd Tuesday of every month. The point is, you can never know what will happen, and thus you should avoid them.

I would be surprised if your teacher marked you down for fixing these things. They have nothing to do with the logic and problem solving aspects of the assignment. If you fix those, your program will still do "what it is supposed to do". The only difference is that you will be adhering to the C standard and good programming practice, and there will be no undefined behavior. You could try to approach your teacher diplomatically, and say something like "I read that void main and fflush(stdin) result in undefined behavior and can cause problems. Should I be using int main(void) instead? Are there better ways to flush the input buffer?"