Hi there...I can get the input from a user...however I need to add them.
I'm thinking I need a loop to add them, and carry the extra if the person adds them.
Keep in mind, the max size is 20, and I have no added the error checking in there.
import java.util.Scanner;
public class LargeNums {
public static final int MAXSIZE = 20;
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
char x ,y;
int c1 = MAXSIZE - 1;
String input1, input2;
int [] num1 = new int[MAXSIZE];
int [] num2 = new int[MAXSIZE];
int [] num3 = new int[MAXSIZE];
System.out.println("Please enter two positive integers with less than " + MAXSIZE + " digits" );
System.out.print("Please enter the first integer: ");
input1 = keyboard.nextLine();
System.out.print("Please enter the second integer: ");
input2 = keyboard.nextLine();
for (int i= input1.length() -1; i>= 0; i--){
x = input1.charAt(i);
if(Character.isDigit(x)){
num1[c1--] = x-48;
}
}
for (int i= input1.length() -1; i>= 0; i--){
y = input1.charAt(i);
if(Character.isDigit(y)){
num2[c1--] = y-48;
}
}
for (int z = 0; z<num1.length; z++){
System.out.print(num1[z]);
}
}
}