I need a little guidence with this array problem I am working on. I need to read two positive integers as char arrays and then output the sum of those numbers as another array. I also need to change the characters the user inputs to integers and I am not sure if I even did that right. I have already done the begining of the code but do not know how I would add the the two integers as arrays together and then store them in another array. If I simply added the elements from each array together and stored the numbers one by one that wouldn't work.
For example if the last number of the first array was 9 and the last number of the second array was 3 then 9 + 3 = 12 but you can't have that because the 1 needs to be caried to the next number and the 2 needs to stay in that slot.
This is my code so far, it is unfinished!
Any suggestion would help, thanks!
include # <iostream>
using namespace std.
int main ()
char FirstNumber ;
char SecondNumer ;
int Num1 ;
int Num2 ;
for ( Idx = 0; Idx < 20; Idx++)
cout<<”Enter the first number, less than 20 digits long, please”;
int Num1 [Idx] = char [Idx] – ‘0’;
for (Idx2 = 0; Idx2 < 20; Idx2++)
cout<<”Enter your second number, less than 20 digits long, please”;
int Num2 [Idx2] = char [Idx2] – ‘0’;