You can't check against sizeof(ary)
because sizeof(ary)
returns the size of the array pointer, not the size of the array.
You need to pass the size (1000) through as a parameter to your functions, or use a global constant.
void prnt(int ary[], arySize){
...
for(i = 0; i < ary; i++){
and call it like
prnt(nums, 1000);
You need to do a similar thing for your removenonprimes function.