A programmer was debugging her program written in a procedural language (c,pascal). Trying to locate a baffling bug , the programmer added a series of write statements which printed out the values of relevant program variables. To her surprise , the bug seemed to vanish and now the program executed to the end without any errors. However , when the write statements were removed, the bug reappeared and the program failed again! Note that the write stataements did not modify any of the variables in the program, the machine and the compiler worked OK, and the external facters (say solar, wind) had no effect whatsoever. The poor programmer was very frustrated.
Explain how the disappearing bug was possible. Give an example program, show the contents of the activation stack at the relevant points of execution and describe the results of the actions with and without the write statements.