Program Sederhana di Pascal

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Cara Membuat Data Base di CMD

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

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 is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Tampilkan postingan dengan label Paskal. Tampilkan semua postingan
Tampilkan postingan dengan label Paskal. Tampilkan semua postingan

Kamis, 07 Mei 2015

PROSEDUR MEMANGGIL PROSEDUR di Pascal


PROSEDUR MEMANGGIL PROSEDUR YANG LAIN
Di dalam prosedur dapat memanggil prosedur yang lainnya.

Contoh :
PROGRAM panggil_prosedur;
USES CRT;
PROCEDURE pro1(x1 : INTEGER);
BEGIN
   x1:=x1*x1;
   WRITELN('Nilai X di Prosedur1 = ',x1);
END;

PROCEDURE pro2(x2 : INTEGER);
BEGIN
   WRITELN('Nilai X di Prosedur2 = ',x2);
   pro1(x2);
END;
VAR
  X : INTEGER;
BEGIN
  CLRSCR;
  WRITE('Masukkan nilai X= '); READLN(x);
  pro2(x);
  READLN;
END.

Hasil :
Masukkan nilai X= 12
Nilai X di Prosedur2 = 12
Nilai X di Prosedur1 = 144

Program Sederhana If atau Kondisi di Paskal

Program Sederhana Kecepatan If atau Kondisi di Paskal




Semoga Dapat Membantu

Program sederhana Prosedur di Paskal 1

Program Prosedure Hitung di Paskal
PROGRAM parameter_value;
USES CRT;
PROCEDURE hitung(A,B,C : INTEGER);
BEGIN
   C:=A+B;
   WRITELN('Nilai di Prosedur');
   WRITELN('NILAI A= ',A,' NILAI B= ',B,' NILAI C= ',C);
END;
VAR
  X,Y,Z : INTEGER;
BEGIN
  CLRSCR;
  WRITE('NILAI X= '); READLN(X);
  WRITE('NILAI Y= '); READLN(Y);
  WRITE('NILAI Z= '); READLN(Z);
  hitung(X,Y,Z);
  WRITELN('Nilai setelah Prosedur');
WRITELN('NILAI X= ',X,' NILAI Y= ',Y,' NILAI Z= ',Z);
  READLN;
END.

Hasil :

NILAI X= 3
NILAI Y= 4
NILAI Z= 5
Nilai di Prosedur
NILAI A= 3 NILAI B= 4 NILAI C= 7
Nilai setelah Prosedur
NILAI X= 3 NILAI Y= 4 NILAI Z= 5



Program sederhana Pascal

Program sederhana menggunakan Prosedur


PROGRAM prosedur;
USES CRT;
PROCEDURE garis;
BEGIN
  WRITELN('----------------');
END;

BEGIN
  CLRSCR;
  garis;
  WRITELN('BELAJAR PROSEDUR');
  garis;
  READLN;
END.

Hasil :
-------------------------------
BELAJAR PROSEDUR
-------------------------------