My code is passing the custom input and two test cases,but not test case 2 and 4.pls help me out

#include
using namespace std;

int main()
{int a[1000],b[1000],c[1000],n,m;
int max,min,max1[1000],min1[1000],carry[1000];
cin>>n;

for(int i=0;i<n;i++)
{
cin>>a[i];
}

cin>>m;

for(int i=0;i<m;i++)
{
cin>>b[i];
}

if(n>=m)
{
max=n;
min=m;
for(int i=0;i<n;i++)
{
max1[i]=a[i];
}
for(int i=0;i<m;i++)
{
min1[i]=b[i];
}

}
else
{
max=m;
min=n;

for(int i=0;i<m;i++)
{
max1[i]=b[i];
}
for(int i=0;i<n;i++)
{
min1[i]=a[i];
}

}
int count=max;

max=max-1;
min=min-1;
carry[max+1]=0;

while((max>=0)||(min>=0))
{
c[max]=max1[max]+min1[min];

c[max]=c[max]+carry[max+1];
 carry[max]=c[max]/10;
 if(max!=0)
 {
 
c[max]=c[max]%10;
}

max–;
min–;

if((min<0)&&(max>=0))
{ min=0;
min1[min]=0;
}
}

for(int i=0;i<count;i++)
{
cout<<c[i]<<", ";
}
cout<<“END”;
return 0;

}

hey @apurvaraina99, please share your code saved in Coding blocks ide so that I can debug it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.