Source Code

Program Urut_Bilangan;

Uses Wincrt;

Var
A,B,C : integer;

Begin
Writeln(‘Program Mengurut Bilangan’);
Writeln(‘=========================’);
Writeln;
Write(‘Masukkan Nilai A: ‘);readln(A);
Write(‘Masukkan Nilai B: ‘);readln(B);
Write(‘Masukkan Nilai C: ‘);readln(C);
Writeln(‘——————–>’);
writeln;
Writeln(‘Urutan bilangan: ‘);
Writeln(‘——————–>’);

if (A<=B) and (A<=C) then
if (B<=C) then
Writeln(A,’ ‘,B,’ ‘,C)

else
Writeln(A,’ ‘,C,’ ‘,B)

else if (B<=A) and (B<=C) then
if (A<=C) then
Writeln(B,’ ‘,A,’ ‘,C)

else
Writeln(B,’ ‘,C,’ ‘,A)

else if (C<=A) and (C<=B) then
if (A<=B) then
Writeln(C,’ ‘,A,’ ‘,B)

else
Writeln(C,’ ‘,B,’ ‘,A)

End.

program angka_hari;

uses wincrt;

var
angka : integer;

begin

writeln(‘PROGRAM KONVERSI ANGKA KE HARI’);
writeln(‘——————————‘);
writeln(”);
write(‘Masukkan angka yang menunjukkan hari: ‘); readln(angka);
writeln(‘——————————‘);

case angka of
1 : writeln(‘Senin’);
2 : writeln(‘Selasa’);
3 : writeln(‘Rabu’);
4 : writeln(‘Kamis’);
5 : writeln(‘Jumat’);
6 : writeln(‘Sabtu’);
7 : writeln(‘Minggu’);
else
write(‘Entri tidak tersedia!’);
end;
end.

program rangkaian;

uses wincrt;
label
a;

var
r1,r2,r3,seri,pilihan : integer;
pararel : real;
ulang : char;

begin
a:
clrscr;
writeln(‘PROGRAM RANGKAIAN PARAREL DAN SERI’);
writeln(‘———————————-‘);
writeln(‘———————————-‘);
writeln(”);
write(‘Masukkan nilai r1: ‘); readln(r1);
write(‘Masukkan nilai r2: ‘); readln(r2);
write(‘Masukkan nilai r3: ‘); readln(r3);
writeln(‘———————————-‘);
writeln(”);
writeln(‘PILIHAN’);
writeln(‘1. Seri’);
writeln(‘2. Pararel’);
writeln(‘———————————-‘);
writeln(”);
writeln(‘Masukkan nomor pilihan kemudian tekan ENTER: ‘); readln(pilihan);

seri:=r1+r2+r3;
pararel:=(r1*r2*r3) / (r1*r2+r2*r3+r1*r3);

if pilihan = 1
then
begin
writeln(‘Total hambatannya: ‘,seri);
end

else if pilihan = 2
then
begin
writeln(‘Total hambatannya: ‘,pararel:2:2);
end

else
begin
writeln(‘Pilihan tak tersedia!’);
end;
writeln(”);
writeln(”);
writeln(‘Mau cari lagi? [Y/T]’);
read(ulang);
if (ulang=’Y’) or (ulang=’y’) then Goto a;
if (ulang=’t’) or (ulang=’T’) then clrscr;
writeln(‘THANK_YOU and GOOD_BYE’);
writeln(‘<press Enter to Exit>’);
readln;
readln;
donewincrt;
end.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

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