Question: 3 . ) Modify the following decimal addition algorithm. So , that it does not print out non - significant leading zeroes; that is ,
Modify the following decimal addition algorithm. So that it does not print out nonsignificant leading zeroes; that is the answer would appear as rather than
Figure Algorithm for adding two digit numbers
Given: and two positive numbers each containing digits, and
Wanted: where
Algorithm:
Step Set the value of carry to
Step Set the value of to
Step While the value of is less than or equal to repeat the instructions in Steps through
Step Add the two digits and to the current value of carry to get
Step If then reset to and reset the value of carry to : otherwise, set the new value of carry to
Step Add to effectively moving one column to the left
Step Set to the value of carry
Step Print out the final answer, cdots
Step Stop
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
