Question: 2. BIGINT add and multiply Write a function to add two large integers of any length, say up to 200 digits. A suggested approach is

 2. BIGINT add and multiply Write a function to add two

2. BIGINT add and multiply Write a function to add two large integers of any length, say up to 200 digits. A suggested approach is as follows: treat each number as a list(array), each of whose elements is a block of digits of that number (say block of 1 to 4 digits, your choice). For example the integer 123456789101112 might be stored with N(1)=1112, N(2)=8910, N(3)=4567, N(4)-123. Then add the two integer (lists) element by element, carrying from one element to the next when necessary. Then write a function to multiply two large integers of any length, say up to 100 digits. Test your functions in the main program that reads two large integers calls the functions and finds their sum and product

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!