Perintah CASE, OF
uses crt;
var
pil :integer;
begin;
clrscr;
writeln('===== MENU =====');
writeln('1: Pilihan 1');
writeln('2: Pilihan 2');
writeln('3: Pilihan 3');
writeln('4: exit');
write('Masukkan pilihan anda = ');readln(pil);
case pil of
1:begin
clrscr;
writeln('Pilihan 1');
readln;
end;
2:begin
clrscr;
writeln('Pilihan 2');
readln;
end;
3:begin
clrscr;
writeln('Pilihan 3');
readln;
end;
4:begin
clrscr;
writeln('EXIT');
readln;
end;
readln;
end.
writeln('Pilihan 2');
readln;
end;
3:begin
clrscr;
writeln('Pilihan 3');
readln;
end;
4:begin
clrscr;
writeln('EXIT');
readln;
end;
readln;
end.
Show
0 Comments
prev
next