Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // Sets the Maximum allowed number of digits to be entered in the array.
- const int Max_Number = 20;
- // Input function for the numbers
- void input_Large_Int ( int a[], int& size_of_A );
- // Outputs the sum of the 2 numbers
- void output_Large_Int ( int a[], int size_of_A );
- // The sum function for the program
- void add ( int a[], int size_of_A, int sum[] );
- int main()
- {
- //Declares the arrays
- int a[Max_Number], b[Max_Number], sum[Max_Number];
- int size_of_A, size_of_B;
- char response='y';
- while (response == 'y' || response == 'Y')
- {
- input_Large_Int( a, size_of_A );
- }
- cout << "Would you like to add two more numbers? ( Y-Yes, N-No ):" << endl;
- cin >> response;
- cout << endl;
- }
- void input_Large_Int ( int a[], int& size_of_A )
- {
- char num_1 [Max_Number], num_2 [Max_Number];
- cout << "Please input the first number that has less than 20 numbers: " << endl;
- cin >> num_1;
- cout << endl;
- if ( num_1[Max_Number] > 20 )
- {
- cout << "Integer Overflow!!!" << endl;
- cout << "Re-Enter a number that has less than 20 digits!!!" << endl;
- }
- cout << "Please input the second number that has less than 20 numbers: " << endl;
- cin >> num_2;
- cout << endl;
- if ( num_2[Max_Number] > 20 )
- {
- cout << "Integer Overflow!!!" << endl;
- cout << "Re-Enter a number that has less than 20 digits!!!" << endl;
- }
- }
Add Comment
Please, Sign In to add comment