## Invitation to Computer Science 8th Edition

Replace Step 8 with Step $8^{*}$ : If $c_{m}=0,$ then print out the final answer $c_{m-1} c_{m-2} \ldots c_{0}$ otherwise, print out the final answer $c_{m} c_{m-1} c_{m-2} \ldots c_{0}$
The algorithm works perfectly except for Step $8 .$ That's the only step that may give us a final answer with a leading $0 .$ So instead let's replace that step with the following if $\ldots$ then $\ldots$ otherwise statement: \begin{aligned} \text { Step } 8^{*} : & \text { If } c_{m}=0, \text { then print out the final answer } c_{m-1} c_{m-2} \ldots c_{0} \\ & \text { otherwise, print out the final answer } c_{m} c_{m-1} c_{m-2} \ldots c_{0} \end{aligned} ______________________________________________________ This new step will now check if the leading digit is a zero. If it is, then the printed answer will start at the next digit (skipped the leading zero). If not, then all digits are printed.