Program to test for divisibility of numbers
for loop

i = MAX+1;
while(--i) {


This should be converted to a for loop, it will become more readable.

Smallest scope possible

Maybe in this challenge C99 is not an option, but I would like to reccomend declaring variables in loop declarations, like:

for(int i=1;i&lt;MAX;i++) 


Avoiding repetition

Please, avoid repetion:

p[0]=0;
p[1]=0;
p[2]=0;
p[3]=0;
p[4]=0;
p[5]=0;
p[6]=0;
p[7]=0;
p[8]=0;
p[9]=0;


Should be:

for (int i = 0; i &lt;= 9; i++) {
    p[i] = 0;
}


and it becomes so much clearer (think what would have happened if you had to set 100 of such items).