Since you have not specified the question, it’s hard to tell exactly. But one of the problems might be
h. You might need more than 20.
You also have bugs here
for (k=0; k<n; k++)
at k=19, h[k+1] will try to access h which is out of bounds.
Also, if you’re trying to submit an answer to one of the questions on codechef, then you don’t need output like " No of Students:" and all. They will just give you Wrong Answers. You can read this
It has been stated there that
Submitted solutions are automatically
compiled and run under Linux test
system. You must keep strictly the
input output specification. In
particular your program must not
printout any additional messages like
‘input the number please’, which are
not specified in the problem