A goto is an unconditional jump within the same procedure. Languages that do not support the notion of procedures (also known as subroutines or functions) are simply treated as being one large procedure. Regardless, the normal flow of execution within any one procedure is always from the top down, one statement after the other -- unless a goto is encountered.
Goto statements allow the programmer to alter the flow of execution within a procedure. When a goto jumps backwards, this may result in statements that have already been executed to execute again. Every time that same goto is encountered, those same statements will execute over and over, thus creating a loop.
However, a goto statement cannot be considered a loop because not all goto statements actually create loops. A goto statement that jumps forwards within a procedure rather than backwards cannot be considered a loop; it is bypassing code, not repeating it. By the same token, a goto statement that jumps backwards might begin executing a section of code that was previously bypassed by an earlier goto. So, without physically reading the code and following the flow of execution, there's simply no way to tell if a goto is a creating a loop or not.
When a programming language supports structured looping statements, including for, for-each, while, do-while and repeat, then it becomes crystal clear that a loop really is being executed. While programmers can obviously use goto statements to create loops, there is no benefit in doing so. After all, code that is easy to read is also easy to maintain. If you want a loop, be specific and use the the appropriate loop structure.
Although you should avoid using goto statements to create loop, that doesn't mean to say goto statements should be avoided altogether. For instance, when you have a nested loop (a loop within a loop) where you wish to break out of the outer loop from within the inner loop, a goto statement is by far the most efficient means of achieving that.
Also keep in mind that in most cases a goto statement will be used in conjunction with an if statement which will decide whether the goto statement should be invoked or not, or perhaps to decide between two different goto statements. A switch structure extends this notion to cater for two or more goto statements, each of which is handled by a case label, thus giving greater structure and control over jumps.
urg.. cant find it
there was none cant you think
i cant finbd the answer any where
do you agree with the author s statement at the end of the text? what scientific explanation or concept do you know that may justify the statement?
john cena made it once he started wrestling.you cant see me!
I don't really think this is a question, I think this a statement
they are 3 feet weighs 44lb cant fly
You cant redesign it once it is in existence. You can repair, renovate or modify it.
They can swim very little due to their dense bone structure.
this question is to hard cant find it
A lquid has a more compact structure.
False, there is probably already salt in it.