A palindrome is a string that, when reversed, is equal to itself. Example of the palindrome includes:
- 1001
- 333
- mom
- dad, etc.
You have to take a number as an input from the user. You have to find the next palindrome corresponding to that number. Your first input should be the number of test cases and then take all the cases as input from the user.
Enter number of test cases: 5
- Enter testcase: 198
- Enter testcase: 45
- Enter testcase: 37
- Enter testcase: 48
- Enter testcase: 95
The next Pallindrom for 45 is 55.
The next Pallindrom for 37 is 44.
The next Pallindrom for 48 is 55.
The next Pallindrom for 95 is 99.