This code should output “9020” but its output is “19020”. I can’t figure out where the extra ten thousand is coming from.
It’s clear that a mistake in this exercise should add an extra five thousand to the output… but why in the world is it an extra ten thousand? I just can’t get my head around it. Somewhere, that five thousand must be doubling up, but I can’t spot where it’s happening.
Instructions, hint, code, and output: