This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program Ubah_Hari_Ke_Tahun_Bulan_Hari; | |
{I.S. : user memasukkan jumlah hari * tolong edit} | |
{F.S. : menampilkan konversi jumlah hari ke tahun, bulan n hari * tolong edit} | |
var | |
jmlh _hari, tahun, bulan, hari : Integer; | |
begin | |
write('Jumlah Hari : '); | |
readln(jmlh_hari); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program Contoh_Penggunaan_Variabel; | |
var | |
A, B, C : Integer; | |
begin | |
A := 3; | |
B := 5; | |
C := A + B; {hasil : 8} | |
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
A : Integer; | |
B : Integer; | |
C : Integer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program_contoh_variabel_dlm_notasi_algo | |
kamus : | |
A, B, C : Integer | |
algoritma : | |
A ← 3 | |
B ← 5 | |
C ← A + B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program tipe_boolean_dan_operator; | |
var | |
A, B, C : Boolean; | |
begin | |
A := true; | |
B := false; | |
C := A and B; | |
writeln; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program tes; | |
var | |
A, B : Integer; | |
begin | |
A := 3; | |
B := 5; | |
writeln(A < B); {hasil : TRUE} | |
writeln(A > B); {hasil : FALSE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program variabel_scope; | |
{kamus utama} | |
var | |
A : Integer; | |
procedure tes(); | |
{kamus lokal} | |
var | |
A : Integer; | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Procedure <nama_procedure>(<daftar parameter>) | |
{I.S. : ..... } | |
{F.S. : ..... } | |
Kamus : | |
{deklarasi variabel} | |
Algoritma : | |
{statement} | |
EndProcedure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program_belajar_procedure | |
var | |
A : Integer; | |
// ---------------------------------------------------- | |
Procedure Tampilkan(input A : Integer) | |
Kamus : | |
{tidak ada} | |
Algoritma : | |
Output(A); // menampilkan nilai A, dimana nilai A sudah didefenisikan sebelum procedure dipanggil. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program_belajar_procedure | |
var | |
A : Integer; | |
// ---------------------------------------------------- | |
Procedure Tampilkan(output A : Integer) | |
Kamus : | |
{tidak ada} | |
Algoritma : | |
Output(A) // menampilkan nilai A, dimana nilai A sudah didefenisikan sebelum procedure dipanggil. |
OlderNewer