MENGURUTKAN BILANGAN

program urutan_nilai;

uses wincrt;

var

a,b,c:integer;

begin

gotoxy(30,1);writeln(‘===========================’);

gotoxy(30,2);writeln(‘”PENENTUAN URUTAN BILANGAN”‘);

gotoxy(30,3);writeln(‘===========================’);

writeln;

write(‘a=’);readln(a);

write(‘b=’);readln(b);

write(‘c=’);readln(c);

writeln;

writeln(‘Jadi urutan bilangan tersebut dari yang terkecil adalah’);

if (a<b) and (a<c) then

begin

write(a:5);

if b<c then write(b:5,c:5)

else

write(c:5,b:5);

end

else

if (b<a) and (b<c) then

begin

write(b:5);

if a<c then write(a:5,c:5)

else

write(c:5,a:5);

end

else

if (c<a) and (c<b) then

begin

write(c:5);

if a<b then write(a:5,b:5)

else

write(b:5,a:5);

end;

end.



Iklan

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 )

Foto Google+

You are commenting using your Google+ 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 )

w

Connecting to %s

%d blogger menyukai ini: