A quick look at the code says you haven't exactly thought about it too much before you dived into code: an average isn't calculated like that.
To calculate an average, you sum all the values, and then divide that by the number of items you added together.
Since you read the number of students and subjects from the user, why are you later assuming that a class has 30 students, and each has 5 subjects?
Even if that was right,
has no information in it at all.
Back that up so you can look at it later and realize just how bad it is, then delete it and start again. Read the assignment carefully, and work out what you need to do in small stages. This may help: How to Write Code to Solve a Problem, A Beginner's Guide