This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Minggu, 19 April 2015

Linked List

Contoh Program Linked List

uses crt;
  type pointer=^typedata;
       Typedata = RECORD
       Nilai : INTEGER;
       Berikutnya : POINTER;
  end;
var list :pointer;

procedure mas_dep(var L : pointer; x : Integer);
var baru : pointer;
 begin
  new(baru);
  baru^.Nilai:=x;
  baru^.Berikutnya:= nil;
  if L= nil then L:=baru
  else
  begin
  baru^.berikutnya :=L;
  L:= baru;
  end;
 end;

procedure cetak (L:pointer);
var bantu : pointer;
 begin
  bantu:= L;
  while bantu <> nil do
  begin
  write (bantu^.Nilai:3);
  Bantu:=bantu^.Berikutnya;
   end;
  end;

 var bil, bil2 : integer;
 JB : char;
  begin
  clrscr;
  new(list);
  list:=nil;
  jb:='Y';
  writeln(' ________________________________');
  writeln('|      Program Linked List       |');
  writeln('|          Masuk Depan           |');
  writeln('|________________________________|');
  readkey;
  clrscr;
  while upcase(Jb)='Y' do
  begin
  clrscr;
   writeln(' ________________________________');
   writeln('| Masukkan bilangan :            |');
   writeln('|________________________________|');
   gotoxy(23,2);readln(bil);
   mas_dep(list,bil);
   writeln;
   writeln('| Lagi [Y/T]  :                  |');
   writeln('|________________________________|');
   gotoxy(17,4);readln(Jb);
   end;
   writeln('|________________________________|');
   writeln('|                                |');
   writeln('|________________________________|');
   gotoxy(3,6);cetak(list);
   writeln;
   readln;
   end.









Minggu, 12 April 2015

Program Pointer Tak Bertipe Pada Pascal

Contoh Program Pointer Tak Bertipe Pada Pascal

uses crt;
var
p : Pointer;
q : ^Byte;
r : array [0..100] of Byte;
i : Byte;
n : integer;
begin
clrscr;
write('Masukkan jumlah data : '); readln(n);
writeln;
writeln;
GetMem(p, 20);
q:=p;
for i:=0 to n do
begin
r[i]:=n-i;
q^:= n-i;
inc(q);
end;
q:=p;
for i:=0 to n do
begin
writeln(' ___________________________');
writeln('|             |             |');
writeln('| r[ ', i ,' ] = ', r[i], '  | p^ ke-', i ,' = ', q^, ' |');
writeln('|_____________|_____________|');
inc(q);
end;
readln;
end.


 

Senin, 06 April 2015

Program Mencari Nilai Maksimum dan Minimum pada pascal

Contoh program mencari nilai yang sudah kita inputkan serta mencari nilai maksimum dan nilai minimum

uses crt;

label awal;

const nmin = 1;
      nmax = 100;

type  arrint = array [nmin..nmax] of integer;
var tabint : arrint;
    x,n,i,indeks,max,min,maks : integer;

function seqsearch1(xx : integer): integer;
  var i : integer;
  begin
    i := 1;
    while ((i<n) and (tabint[i] <> xx)) do
      i:=i+1;
      if tabint[i] = xx then
        seqsearch1:=i
        else
        seqsearch1:=0;
  end;

function maksimum (tabint: arrint; n : integer) : integer;
  var i, max : integer;
  begin
   for i:=2 to n do
   if max<tabint[i] then
   max:=tabint[i];
   maksimum:=max;
  end;

function minimum (tabint: arrint; n : integer) : integer;
  var i, min : integer;
  begin
   for i:=1 to n do
   if min>tabint[i] then
   min:=tabint[i];
   minimum:=min;
  end;


begin
  clrscr;
  writeln;
  writeln('      Progaram Pencarian Nilai');
  writeln;
  writeln;
  writeln;
  write('Masukkan Jumlah Data = '); readln(n);
  writeln;
  writeln;
  for i:=1 to n do
    begin
       write('Data[',i,'] = '); readln(tabint[i]);
     end;
     clrscr;
    writeln;
    writeln;
        write ('  Nilai yang dicari : '); readln(x);
    indeks:=seqsearch1(x);
    writeln;
      if indeks <> 0 then
      write ('  Nilai : ',x,' ditemukan pada indeks ke-',indeks)
       else
      write('   Nilai : ',x,' tidak ditemukan !');

 begin
 writeln;
  maks:=maksimum(tabint,n);
  min:=minimum(tabint,n);
  writeln;
  writeln ('* Nilai maksimum : ',maks);
  writeln ('* Nilai minimum  : ',min );
  readln;
  end;
 end.


sealkazzsoftware.blogspot.com resepkuekeringku.com