upyzl wrote:
Quote:
#include <stdio.h>
[... code snipped; see up-thread ...]
It would be a good idea to explain what your code is
supposed to do (we can only see what it actually does), and
how what it actually does fails to meet your purposes. Do
you take a vow of silence before you visit your doctor?
Still, I can see at least one thing that looks wrong.
You can probably discover it for yourself by working through
a small example with pencil and paper: Write down the values
of the program's variables and start following through the
code step by step, as if you were the computer (this can be
a surprisingly effective way to discover mistakes). An
example that highlights the flaw I spotted is to try adding
181 and 19.
(A hint for future revisions: When adding the numbers,
you may find it easier to start at the ones' place and work
upward than to start at the topmost digit and work down.)
--
Eric Sosman
esosman@ieee-dot-org.invalid