Caculate avarage from array values

i wrote following code to calculate average of the values entered to the array.After displaying the output following error was displayed.

"Run-Time Check Failure #2 - Stack around the variable 'marks' was corrupted.
A buffer overrun has occurred in q 3 410005111.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program. "

"Run-Time Check Failure #2 - Stack around the variable 'marks' was corrupted., the buffer over run would mean that while writing to another variable the code has written outside of where it should, the only way for us to help is for you to post more of your code.

I commented various things throughout the code. And I would highly suggest not repeating similar code. Those ten different students are all easily combined together with an additional for loop. I also added two #define s. They simplify remembering a number and make it easy to change later.