Format : If (Kondisi) then
(Perintah)
Else
(Perintah)
Contoh Script :
program Project3;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
t:integer;
begin
writeln('NIM : 114224008');
writeln('NAMA : AZIZUN NURRACHMAN');
writeln('==============================');
writeln(' PROGRAM SELEKSI KARYAWAN BARU ');
writeln('==============================');
writeln(' ');
write('Masukkan Tinggi Badan Anda = '); readln(t);
If t > 169 then
begin
writeln('Tinggi Anda ' , t, ' cm');
writeln('Anda Layak Bekerja di Kantor Kami...!!!');
writeln('SELAMAT ANDA DITERIMA...!!!');
writeln('==============================');
end
else
begin
writeln('Tinggi Anda ' , t, ' cm');
writeln('Maaf Tinggi Badan Anda Kurang Mencukupi Persyaratan Kami...!!!');
writeln('MOHON MAAF ANDA TIDAK DITERIMA...!!!');
writeln('==============================');
end;
readln;
{ TODO -oUser -cConsole Main : Insert code here }
end.
0 komentar:
Posting Komentar