From the C Standard (6.7.9 Initialization)
3 The type of the entity to be initialized shall be an array of unknown size or a complete object type that is not a variable length array type.
So instead of this declaration with an initializer
int marks[n]={0};
use
int marks[n];
memset( marks, 0, n * sizeof( int ) );
Pay attention to that n may not be equal to zero.