Moshi-moshi Minna-san.
stelah contoh coding Case OF, sekarang contoh coding IF bersarang atau Nested IF.
Nested IF atau biasa dikenal IF bersarang adalah statement IF yang berada di dalam Statement IF lainnya.
contoh:
uses wincrt;
var
merk: string;
berat:integer;
begin
write('Merk Detergent : ');readln(merk);
write('Berat (kg) : ');readln(berat);
if merk='Rinso' then begin
if berat = 5 then harga:=50000
else
if berat = 1 then harga:=15000
end;
if merk='Daia' then begin
if berat = 5 then harga:=30000
else
if berat = 1 then harga:=10000
end;
writeln('Harga : Rp.',harga:0:0);
end.
jya nee minna, hope this will help..
hey, it's me !
- Alodia Pratama
- I'm Just an ordinary girl, born 17 June. ^^ Like anime, manga and I'm egoist,childish, nijikon and.....(silence-deep breath).. wanna be a good mother and wife someday. :D
Labels
#FatwaRindu
(3)
Coding-Pascal
(5)
Curhat
(6)
dheiiapratama..^^
(4)
Fairy Tail
(2)
Lirik Lagu
(7)
mindless
(3)
MySQL
(2)
nijikon
(2)
sad story
(3)
Jumat, 02 Desember 2011
Langganan:
Posting Komentar (Atom)
0 comments:
Posting Komentar