Find the largest exponent x such that p^x evenly divides n
I would do an "early exit" in the case \$ p \le 1 \$ and 
save an indentation level for the "main case":

if (p &lt;= 1) {
    return -1;
} 


The status variable is not needed, the while-loop can be
simplified to

int count = 0;
while (n % p == 0) {
    count++;
    n = n / p;
}


Your program should check if the input number \$ n \$
is zero, otherwise it will run into an infinite loop in that case.