praktikum prolog mesin ketik

PREDICATES
 nondeterm ulang
 nondeterm mesinketik

CLAUSES
 ulang.
 ulang:-ulang.

 mesinketik:-
  ulang,
  readchar(C), /* baca sebuah karakter, ikat ke variabel C */
  write(C),
  C = '\r'. /* Apakah ditekan Enter? Gagal jika tidak */


GOAL
 Mesinketik,nl.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Praktikum prolog pengurangan

DOMAINS
 kurang=integer
 bagi=real
PREDICATES
 bagikan(bagi,bagi,bagi)
 kurangkan(kurang,kurang,kurang)
CLAUSES
 Bagikan(X,Y,Bagi):-
   Bagi=X/Y.
 Kurangkan(X,Y,Kurang):-
   Kurang=X-Y.
GOAL
  Kurangkan(54,32,Kurang).

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Praktikum prolog penjumlahan

DOMAINS
 kali,jumlah=integer
PREDICATES
 tambahkan(jumlah,jumlah,jumlah)
 kalikan(kali,kali,kali)
CLAUSES
 tambahkan(X,Y,Jumlah):-
   Jumlah=X+Y.
 kalikan(X,Y,Kali):-
   Kali=X*Y.
GOAL
  Kalikan(32,54,Kali).

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Bahasa C++ Include

#include <iostream>
#include<conio.h>
int main(){int i, j;
for (i=1; i <= 6 ;i++){for (j=1; j <= i; j++)
cout << "*";cout <<endl;}getch();return 0;
}
for (i=1; i <= 6 ;i++)
{for (j=1; j <= i; j++)cout << "*";cout <<endl;}getch();return 0;
}

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Struktur Data Rata-rata genap

program Tipe_B_rata_rata;
uses crt;
var
x, n, jumlah: integer;
U : real;
begin
clrscr;
n:= 10;
 for x := 1 to n do
  begin
   if x mod 2 = 0 then
   jumlah := jumlah +x;
  end;
 u:=jumlah - n;
 writeln ('selisih = ', U:0:2);
 readln;

end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Struktur Data Rata0rata Genap

program Tipe_B_rata_rata;
uses crt;
var
x, n, jumlah: integer;
U : real;
begin
clrscr;
n:= 10;
 for x := 1 to n do
  begin
   if x mod 2 = 0 then
   jumlah := jumlah +x;
  end;
 u:=jumlah / n;
 writeln ('selisih = ', U:0:2);
 readln;

end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Struktur data Rata-rata Ganjil

program Tipe_B_rata_rata;
uses crt;
var
x, n, jumlah: integer;
U : real;
begin
clrscr;
n:= 10;
 for x := 1 to n do
  begin
   if x mod 2 = 1 then
   jumlah := jumlah +x;
  end;
 u:=jumlah / n;
 writeln ('rata-rata = ', U:0:2);
 readln;

end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Struktur Data segitiga bilangan

uses crt;
var
i,j : integer;
begin
clrscr;
for i := 15 downto 3 do
 begin
  if i mod 3 = 0 then
   begin
    for j := 3 to i do
     begin
      if j mod 3 = 0 then
      write (j, ' ');
      end;
     writeln;
    end;
   end;
  readln;

 end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Struktur Data segitiga 12345

uses crt;
var
i,j : integer;
begin
clrscr;
for i := 5 downto 1 do
 begin
    for j := 1 to i do
      write (j, ' ');
     writeln;
     end;
  readln;

 end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Struktur Data segitiga 2

uses crt;
var
i,j : integer;
begin
clrscr;
for i := 10 downto 2 do
 begin
  if i mod 2 = 0 then
   begin
    for j := 2 to i do
     begin
      if j mod 2 = 0 then
      write (j, ' ');
      end;
     writeln;
    end;
   end;
  readln;

 end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0

Struktur Data Segitiga @

uses crt;
var
i,j : integer;
begin
clrscr;
for i := 10 downto 2 do
 begin
  if i mod 2 = 0 then
   begin
    for j := 2 to i do
     begin
      if j mod 2 = 0 then
      write (j, ' ');
      end;
     writeln;
    end;
   end;
  readln;

 end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read User's Comments0