i change i=4

no wornings or errors

but the summation is wrong if there is carry

Code:

#include<iostream>
using namespace std;
int main()
{
int arr[5],arr1[5],sum[5],carry[6]={0};
int i ,c;
cout<<"number 1.:"<<endl;
for(i=0;i<5;i++)
{
cin>>arr[i];
}
cout<<"number 2.:"<<endl;
for(i=0;i<5;i++)
{
cin>>arr1[i];
}
for(i=0;i<5;i++)
{
c=arr[i]+arr1[i]+carry[i];
if(c==0)
{
sum[i]=0;
carry[i+1]=0;
}
else if(c==1)
{
sum[i]=1;
carry[i+1]=0;
}
else if(c==2)
{
sum[i]=0;
carry[i+1]=1;
}
else if(c==3)
{
sum[i]=1;
carry[i+1]=1;
}
}
for(i=0;i<5;i++)
{
cout<<"sum= "<<sum[i]+carry[i+1];
cout<<endl;
}
return 0;
}