Can anyone please tell me what’s wrong with my code? I have tried multiple inputs and getting the correct palindromes but am still getting WA after submitting.
I have written my code in C
#include<stdio.h>
int main()
{
int t,K;
scanf("%d",&t);
for(int i = 0;i<t;i++) {
scanf("%d",&K);
if(K<=1000000){
for(int j = K+1; ; j++) {
int rem,num=0,n = j;
while(n!=0) {
rem = n%10;
num = num*10+rem;
n = n/10;
}
if(num == j) {
printf("%d\n",num);
break;
} else {
continue;
}
}
}
}
return 0;
}