I'm not sure why it only prints the last student's information and I need the display to be separate from the user input. So it can print a list of all the user has put in the input.
Each time the for loop on line 17 executes, you overwrite your data each time, so the last data is the only info left in the variables. You need to store the data in a data structure, such as an array. An array's size must be fixed at compile time.
Also, when you use scanf, make use of it's return value to see if it worked.
Line 29 can use the += operator, rather than sum = sum +