I don’t see anything wrong with that. Show us your errors and read them because for example I saw that you are using j
in your loops and it’s never declared. Also what this code should do in your opinion?
int n, primecap[n], int1, i;
n=50;
initArray(primecap[n]);
Your problem is that you don’t know what you are writing.