Producing debug-output is very useful for monitoring the runtime state of a program. At tactical points in the source printf- or cout-statements are placed that will show when some specific code is executed. It's also very practical to print out the value of key-variables to see what value they have and how they change.