Source Code Pascal Konversi Hari


Di bawah ini adalah source code pascal untuk menkonver jumlah hari ke tahun, bulan, hari

{—copy here—}

program konversi_hari;
uses wincrt;
var
hari,bulan,tahun,sisa_hari : integer;
begin
writeln(‘Menghitung hari’);
writeln;
write(‘Jumlah hari =’);
readln(hari);

tahun := hari div 365;
sisa_hari := hari mod 365;
bulan := sisa_hari div 30;
sisa_hari := sisa_hari mod 30;

writeln;
write(hari,’ hari= ‘,tahun,’ tahun ‘);
write(bulan,’ bulan ‘,sisa_hari,’ hari’);
end.

—Selamat Mencoba—

Iklan

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s