Sum of two arrays why all test cases are not passing

Scanner scn = new Scanner(System.in);
int N = scn.nextInt();
int[] arr=new int[N];
for(int i=0 ; i<N ; i++)
{
arr[i]=scn.nextInt();
}
int M =scn.nextInt();
int[] array = new int[M];
for(int i=0 ; i<M ;i++)
{
array[i]=scn.nextInt();
}
int[] sum =new int[N>M?N:M];
int c=0;
int i =arr.length-1;
int j=array.length-1;
int k=sum.length-1;
while(k>=0)
{
int d=c;
if(i>=0)
{
d=d+arr[i];
}
if(j>=0)
{
d=d+array[j];
}
c=d/10;
d=d%10;
sum[k]=d;
i–;
j–;
k–;
}
if(c!=0)
{
System.out.println©;
}
for(int val:sum)
{
System.out.print(val+", ");
}
System.out.print(“END”);
}
}

consider a test case like
3
5 5 4
3
7 7 8
the answer should be 1, 3, 3, 2, END
correct this

yes I have printed carry if it is not 0

ok i have understood