GOTO Statement Considered Harmful

Can any program written using GOTO statements be transformed into an equivalent program without GOTO statements, but just IF statements and WHILE loops?

  • Two programs are equivalent if they map the same input to the same output.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

This result is called the Structured Program Theorem or the Bohm Jacopini Theorem.

Proof: The following transformation removes all the gotos but preserves everything else.

Soumava Pal
Feb 6, 2016

Actually I knew the Boehm Jacopini Result! :P

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...