hi i am biggnner to programming

so i don't know exactly how to add binary numbers (5bit)

i tried of course

what's wrong with it ? can you explain itCode:#include <iostream> using namespace std; int main () { int arr[5],arr1[5]; int carry=0,sum,sum[6],i; cout<<"number one : "; for ( i=0;i<5;i++) { cin>>arr[i]; } cout<<"\n number two: "; for ( i=0;i<5;i++) { cin>>arr1[i]; } for ( i=0;i<5;i++) { if (arr[i]==0 && arr1[i]== 0 && carry== 0) sum=0; else if (arr[i] == 0 && arr1[i]==1 && carry== 0) sum=1; else if (arr[i]== 1 && arr1[i] == 0 && carry == 0) sum=1; else if (arr[i] == 1 && arr1[i] == 1 && carry ==0) { sum=0; carry=1; } else if (arr[i] == 0 && arr1[i] == 0 && carry == 1) { sum=0; carry=0; } else if (arr[i] ==0 && arr1[i] == 1 && carry ==1 ) sum=0; else if (arr[i] == 1 && arr1[i] == 0 && carry == 1) sum=0; else if (arr[i] == 1 && arr1[i] == 1 && carry ==1) sum=1; else cout<<" WRONG!"; } sum[i]=sum; } for(i=0;i<6;i++) { cout<<" sum = "<<sum[i]<<endl; } return 0; }

and if there is another way to add binary numbers light me plzzz