Sum of two arrays

2 test cases getting failed? what’s wrong?
code
#include<bits/stdc++.h>

using namespace std;

int main()
{

ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,m;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
cin>>m;
int b[m];
for(int i=0;i<m;i++)
cin>>b[i];
vector c;
reverse(a,a+n);
reverse(b,b+m);
int minm=min(n,m);
int carry=0;
for(int i=0;i<minm;i++)
{
int sum=a[i]+b[i]+carry;
if(sum>9)
{
c.push_back(sum%10);
carry=sum/10;
}
else
{
c.push_back(sum);
carry=0;
}
}
//cout<<carry<<endl;
if(minm==n)
{
for(int i=n;i<m;i++)
{
if(carry!=0)
{
c.push_back(b[i]+carry);
carry=0;
}
else
c.push_back(b[i]);
}

}
else
{
for(int i=m;i<n;i++)
{
if(carry!=0)
{
c.push_back(a[i]+carry);
carry=0;
}
else
c.push_back(a[i]);
}
}
reverse(c.begin(),c.end());
for(int i=0;i<c.size();i++)
cout<<c[i]<<", ";
cout<<“END”;

return 0;

}

@rockstarpkm,
Why have you asked the same doubt again…??

We are already discussing your same doubt here->

I have already marked the doubt as resolved, btw thanks, it worked.