0

okay.. i'm really stuck on this program assignment

i have to add two arrays (20 digits long) than sum the two.

what i have done so far is (or at least attempted) is putting the digits into a temporary array than moving them into one of the arrays i want to sum, than doing that with the second array i want to sum (i had to put the digits in from last to first). now i'm trying to sum and print the array i'm not exactly sure what my problem is yet, i figured i would get it online than try to debug it while i also get some help

anyway any input is appreciated.

here is what i have so far.

```
#include <iostream>
using namespace std;
int main()
{
char temp[21];
int i=0, j, k, z, q;
char augend[19];
char addend[19];
char count;
char sum;
char total;
char carry;
cout << "This programs adds two positive integers up to 20 digits long." << endl << endl;
cout << "Enter augend digits";
{
cin >> temp[0];
/*if(temp > 0)
break;*/
while(temp[i]!= '\n');
{
i=i+1;
cin >> temp[i];
}
for (j=i-1, k=19; j>=0; j--, k--)
{
augend[k] = temp[j];
}
cout << "Enter addend digits";
cin >> temp[0];
i=0;
while(temp[i]!='\n');
{
i=i+1;
cin >> temp[i];
}
for (z=i-1, q=19; q>=0; j--, q--)
{
addend[k] = temp[z];
}
while(temp[count]!='\n')
for(i=count-1; j=19; i>=0; i--; j--)
augend[j] = temp[i];
carry = 0;
total = augend[i] + addend[i] + carry;
if total > 10;
{
sum[i] = total - 10;
}
else
carry = 0;
sum[i]=total;
i = 0;
while(addend[i] != '\n');
{
cout << augend << " + " << addend << " = " << i << endl;
++i;
}
}
cout << "- is not a digit" << endl;
return 0;
}
```

ALso

i tried just printing my temp array, when i run it cin the digits and just stops there.. i dont see whats the problem.

```
#include <iostream>
using namespace std;
int main()
{
char temp[21];
int i=0, j, k, z, q;
char augend[19];
char addend[19];
char count;
char sum;
char total;
char carry;
cout << "This programs adds two positive integers up to 20 digits long." << endl << endl;
cout << "Enter augend digits: ";
cin >> temp[0];
while(temp[i]!= '\n');
{
i=i+1;
cin >> temp[i];
}
cout << temp;
return 0;
}
```