Program Prolog (amat sangat) Sederhana

Listing

?-

write(“Program Sederhana Prolog”),nl,nl,

write(“Masukkan nama : “), read(Nama),

write(Nama),nl,

write(“Masukkan kelas : “), read(_kelas),

write(_kelas),nl,nl,

write(“Menghitung Luas Persegi Panjang!”),nl,

write(“Masukkan panjang : “), read(P),

write(P),nl,

write(“Masukkan lebar : “), read(L),

write(L),nl,

LUAS is P*L,

write(“Luas Persegi Panjang = “),

write(LUAS).

PS: pada saat program di-run , untuk menginput nilai variabel Nama & _kelas  dengan 2 kata atau lebih, pake tanda (“); seperti pada contoh output di bawah, saat menginput nilai untuk variabel Nama yaitu “Aresa Riskiana” , contoh untuk variabel _kelas yaitu “3 IA03” …

OUTPUT

About resariski

me - Resa - a girl who was born at December 16th is the youngest daughter (from 4 brothers) in my family. This is my official weblog. View all posts by resariski

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: