Spoj/codechef..next palindrome

Guys…i am trying to solve this question and i have checked for many testcases but i can’t figure out where my code is failing exactly…any idea??

Here is a link to my solution : http://www.codechef.com/viewsolution/4569968

post question link too

You code isn’t working when input is a palindromic number, except when input is all 9.

Ex:

8
4444
22

ok…but it is giving 4554 for 4444. isn’t it correct??

This language is quite difficult for me. I’m still practicing with it.

Your code is giving wrong answer on this case

1
1994993993994991