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 : CodeChef: Practical coding for everyone

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

Ex:

8
4444
22

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

Your code is giving wrong answer on this case

1
1994993993994991

post question link too

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