program dasar_caseof;
var
x:integer;
begin
writeln('belajar case of dasar');
writeln;
write('masukan sebuah angka =');readln(x);
case x of
0:writeln('x bernilai 0');
1:writeln('x bernilai 1');
2:writeln('x bernilai 2');
3:writeln('x bernilai 3');
else
writeln('x tidak bernilai 0,1,2,3');
end;
end.
var
x:integer;
begin
writeln('belajar case of dasar');
writeln;
write('masukan sebuah angka =');readln(x);
case x of
0:writeln('x bernilai 0');
1:writeln('x bernilai 1');
2:writeln('x bernilai 2');
3:writeln('x bernilai 3');
else
writeln('x tidak bernilai 0,1,2,3');
end;
end.
0 comments:
Posting Komentar