The question asks for Your output must consist of a single integer, the smallest prime
palindrome greater than or equal to N. In your code you are doing : for (i = n + 1; i <= 1004000; i++) which is basically finding the prime palindrome strictly greater than n.

Your loop should be : for (i = n ; i <= 1004000; i++) i.e. start from n instead of n+1.
Changing n to n+1 gets your code AC . Here is the accepted version of your code.

you are using a brute force approach for checking primes and reverse. You should try optimizing that approach. Although it does not matter much in this problem, you might face difficulties later on more demanding problems .I would suggest you read about the Rabin Miller Primality test which is a faster method of checking if a number is prime or not.

Besides you could also try simpler things like skipping all the even numbers since they cannot be prime to optimize your code