Program Prolog Sederhana – Membuat Menu

Listing1
?-

testaresa.

testaresa:-

write(“===MENU===”),nl,

write(“1. Penjumlahan”),nl,

write(“2. Perkalian”),nl,

write(“3. Exit”),nl,nl,

write(“Masukkan Pilihan: “),

read(PIL),write(PIL),nl,

(PIL=1,nl,

write(“Masukkan Nilai A : “),
read(A),write(A),nl,

write(“Masukkan Nilai B : “),
read(B),write(B),nl,

NilC is A+B,

write(“Hasil Penjumlahan A dan B = “),
write(NilC),nl,nl,

testaresa;

PIL=2,nl,

write(“Masukkan nilai P : “),read(P),
write(P),nl,

write(“Masukkan nilai L : “),read(L),
write(L),nl,

LUAS is P*L,

write(“Hasil Perkalian P dan L = “),
write(LUAS),nl,nl,

testaresa;

PIL=3,nl,
write(“Selesai”),nl).

Categories: Uncategorized | Tinggalkan komentar

Navigasi pos

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Blog di WordPress.com.

%d blogger menyukai ini: