For this program I have to be able to input two positive arrays up to 20 digits long and add them together, I think I have the input part right I am just having difficulty adding the two arrays together and outputting the new sum array...any help or advice would be great, here is what i have so far:


Quote Originally Posted by theflash View Post
#include <iostream>
#include <iomanip>

using namespace std;

int main()

{
int count = 0, number;
char first[20], second[20], sum[20];
cout << "Enter the augend: ";
cin >> noskipws >> first[0];
cout << endl;
while( first[count] != '\n')
{
count++ ;
cin >> first[count];
}
for ( number = count-1; number >= 0; number--)
cout << first[number];
cout << endl;

count=0;
cout << "Enter the adden: ";
cin >> noskipws >> second[0];
cout << endl;
while( second[count] != '\n')
{
count++;
cin >> second[count];
}
for(number = count-1; number >= 0; number--)
cout << second[number];
cout << endl;


number=0;
for(number=0;number<20;number++)
{
sum[number] = first[number] + second[number];
}
cout << sum[number];
cout << endl;

return 0;
}