Test cases for next palindrome problem.

I have tried many testcases like

1 (2),999 (1001),4599954 (4600064), 45874 (45954) …
it my code is working correctly ,still Wrong ans.Can any body provide with more cases.

2 Likes

Your output for the test case:

3

1

2

3

is coming as :

234

Take a look at the sample test cases I used and their corresponding output here: http://ideone.com/7y0D9v

Hello @jigsaw004 ,
I ran your latest submission (Submission ID = 1652280 ) on some very simple input .
There is output formatting mistake
For input
2 (number of test cases )
9 (test case 1)
99 ( test case 2 )
It gives output : 11101 as a single number , rather than 11 on first line and 101 on second line . Your code gives correct output in the sample test case given with the problem statement which also has 2 test cases . So , I guess you are giving the necessary “endline” at some place while not giving “endline” in some cases .

oops sorry the question belonged to @paragjain and @jigsaw004 has already answered it. sorry again .

#include<stdio.h>
int revese(int);
int main()
{
int num,x;
int arr[500];
int i;

scanf("%d",&num);
i=num;

while(num>0)
{
scanf("%d",&arr[i-num]);
num–;

}
num=i;
while(num!=0)
{
arr[i-num]=arr[i-num]+1;

while(x=1)
{

if(arr[i-num]==revese(arr[i-num]))
break;
else arr[i-num]++;}
printf("%d\n",arr[i-num]);
num–;}

return 0;

}
int revese(int num)
{
int rev=0;
while(num!=0)
{
rev=rev*10+(num%10);
num=num/10;
}
return rev;
}

why this showing a wrong answer

Hi guys I am having a similar issue here is my code #define TRUE 1#define FALSE 0#include <stdio.h>#include <stdlib.h>int - Pastebin.com I get wrong answer? Not sure for which test case my code fails a little help ?

FOUND my mistake it was with even function

@jigsaw004 i could not find the input test cases in the given ideone link.pleas help.