Program Pascal Break & Continue
Program Pascal Break & Continue
__________________________________
Program Breaking;
var
a: integer;
begin
a := 10;
while a < 20 do
begin
writeln('Nilai dari a adalah ', a);
a:=a +1;
if( a > 15) then
break; {menghentikan perulangan}
end;
end.
_________________________________
Program Lanjut;
var
a: integer;
begin
a := 10;
repeat
if( a = 15) then
begin
a := a + 1;
continue;
end;
writeln ('Nilai a adalah ', a);
a:= a+1;
until ( a = 20 );
end.
No comments