- Pascal Tutorial
- Pascal Useful Resources
- Selected Reading
Academia.edu is a platform for academics to share research papers. CONTOH PROGRAM PASCAL REPEAT UNTIL. Program Deret. While (Ctr do.
A goto statement in Pascal provides an unconditional jump from the goto to a labeled statement in the same function.
NOTE − Use of goto statement is highly discouraged in any programming language because it makes difficult to trace the control flow of a program, making the program hard to understand and hard to modify. Any program that uses a goto can be rewritten so that it doesn't need the goto.
Syntax
The syntax for a goto statement in Pascal is as follows −
![Perulangan Perulangan](/uploads/1/2/6/2/126261390/910666552.jpg)
Here, label must be an unsigned integer label, whose value can be from 1 to 9999.
Flow Diagram
Example
The following program illustrates the concept.
When the above code is compiled and executed, it produces the following result −
Please note that −
- In Pascal, all labels must be declared before constant and variable declarations.
- The if and goto statements may be used in the compound statement to transfer control out of the compound statement, but it is illegal to transfer control into a compound statement.
pascal_loops.htm