Write a program that allows the user to enter two positive integers and outputs
ID: 3777527 • Letter: W
Question
Write a program that allows the user to enter two positive integers and outputs their sum. Sounds simple? Here's the catch: The numbers may be any size! They may be way too large to store in a single variable. You may not assume any particular maximum number of digits. Here are two sample runs: Enter first positive integer 874357043257824 38757285045089847 Enter second positive integer 4523852345234255895 Sum m 87435704325786962 609630279345742 Enter first positive integer 9999999 99999999999 99999999999 9999999 9999 9999999999999 99999999999999999 9999 9999 9999 9999 999 9999 9999 99 9999 9999 9999 9999999999999 999999999999 99 99999999999999999999 Enter second positive integer: 1 Sum 100000000000000000000000000000000000000000000000000 00000000000000 0000000000000000000000000000000000000000000000000000000000 00000000000000 000000000000000000000000Explanation / Answer
Enter the first positive integer: 1010101
Enter the second positve integer: 0
Summation of two number is: 1010101
Enter the first positive integer: 1010101
Enter the second positve integer: 0
Summation of two number is: 1010101
Enter the first positive integer: 234384524854285894398563489569843583456834653459345673499643643654435764365345674534795674357673456734698459834
Enter the second positve integer: 45437564397569374567934675634756973469573495934598439756793467953479597349876349765973479563749579346795634796597346
Summation of two number is: 45437798782094228853829074198246543313156952769251899102466967597123251785640715111648014359423937020252369495057180
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.