ABSTRACT

Branch statements allow branching or jumping to a particular statement as demanded by the program logic. The goto statement is an unconditional branch statement. The syntax is goto nnn, where nnn is a statement number, which must refer to an executable statement within the same unit as goto. The statement where the control is transferred may be before or after the goto statement; for example, goto 20 will transfer the control to the statement number 20 unconditionally. Indiscriminate use of goto makes a program much unstructured and should be avoided as far as practicable. In fact, there are schools that advocate goto-less programming. There are other schools that believe it is possible to write a structured program with restricted use of goto, especially when the jumps are very small. However, the version of Fortran provides several other statements, which facilitate writing a goto-less program with ease.