Explore BrainMass
Share

C++ Program to Multiply Two Large Positive Integers

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Devise a C++ program which can multiply two positive numbers and print them and their product. It should handle integers up to 25 digits.

Input for this program is provided in attached file "BigNumber.dat", one number per line. There are several pairs of numbers to process.

The printed answer should be right-justified and have no leading zeros.

© BrainMass Inc. brainmass.com March 21, 2019, 8:35 pm ad1c9bdddf
https://brainmass.com/computer-science/cpp/c-plus-plus-program-multiply-two-large-positive-integers-340811

Attachments

Solution Preview

Please find attached an implementation to handle large numbers multiplication. You can easily change the size of numbers that you can/want-to handle by changing the value of macro NUMBER_LENGTH (currently set to 25).

You can ...

Solution Summary

Solution uses simple standard multiplication technique, and it makes used of macro NUMBER_LENGTH (currently set to 25) to easily change the size of large numbers that the program can handle.

$2.19