Contoh Looping pada Program Pascal Tiga Variabel
uses crt;
var a,b,c : integer;
begin
clrscr;
for a:= 1 to 5 do
begin
for b:= 1 to 5 do
begin
if(a mod 2)=1 then
if(b mod 2)=1 then
write(b,' ');
if(a mod 2)=0 then
if (b mod 2)=0 then
write(' ',b);
end;
writeln;
end;
readln;
end.
Outputnya adalah:
1 3 5
2 4
1 3 5
2 4
1 3 5
Variabel C nya mana mas?
BalasHapus