#include<stdio.h>
#include<ctype.h>
int num[100001];
void carry(int [], int);
int main()
{
int test, counter, bit, flag;
int start, end;
scanf("%d",&test);
for(counter = 0; counter <= test; counter++)
{
flag= 0, num[flag] = 0;
while((bit = getchar()) != '\n')
num[++flag] = (int)(bit - '0');
if(counter != 0)
{
if(flag == 1)
printf("%d\n",11);
else
{
end = flag;
carry(num , end);
start = (num[0] == 0)?1:0;
while(start <= end)
{
if(num[start] < num[end])
carry(num,end-1);
if(num[start] == num[end])
;
else
{
num[end] = num[start];
}
start++;
end--;
}
for(bit = 0; bit <= flag; bit++)
{
if(bit == 0 && num[0] == 0)
;
else
printf("%d",num[bit]);
}
printf("\n");
}
}
}
return 0;
}
void carry(int num[], int end)
{
int carry = 1;
while(carry != 0)
{
num[end] = num[end] + 1;
if(num[end] == 10)
{ num[end] = 0;
end--;
carry= 1;
}
else
carry = 0;
}
}
Can anyone tell me why i am getting Runtime Error(SIGSEGV) during submission.