The Next Palindrome on SPOJ ; Problem Code: PALIN

Problem Link: The Next Palindrome

Recently I am solving the problem of finding the immediate next palindrome to the given number N as described in the problem link above.
I have implemented the algorithm and ran on different test cases, and in all of them I am getting the right answer which I verified using SPOJ Toolkit.
I have gone through the links:

  1. Test Case for the next palindrome related to test-cases for this problem on Code-Chef, and also gone thorugh the Stack-Overflow thread related to this problem.

Can anyone tell me the test cases where my code will fail, as on online judges it is showing WA every-time I submit. My Code Link

your code link is not working !

@macdod Can you check now? It’s working now.

I don’t find any problem in your code. It was working fine on my system. But,

.
It gives the wrong answer on online ide, particularly in the case when your input is all nine. you need to print your char array, character-wise upto the required length to avoid these errors.i’m posting your modified code.

you can find your modified code here.

@macdod Thanks. Instead of implementing your changes I initialised the string at the starting by using memset() function.