Sisabagi FPC


Program Sisabagi;
uses crt;

var
D, S  : Integer;
SS    : STRING[1];
BINER : STRING[10];

BEGIN
D := 250;
BINER := ”;

S := D MOD 2;
D := (D-S) div 2;
if (S = 1) then SS:=’1′ else SS:=’0′;
BINER := SS+BINER;

S := D MOD 2;
D := (D-S) div 2;
if (S = 1) then SS:=’1′ else SS:=’0′;
BINER := SS+BINER;

S := D MOD 2;
D := (D-S) div 2;
if (S = 1) then SS:=’1′ else SS:=’0′;
BINER := SS+BINER;

S := D MOD 2;
D := (D-S) div 2;
if (S = 1) then SS:=’1′ else SS:=’0′;
BINER := SS+BINER;

S := D MOD 2;
D := (D-S) div 2;
if (S = 1) then SS:=’1′ else SS:=’0′;
BINER := SS+BINER;

S := D MOD 2;
D := (D-S) div 2;
if (S = 1) then SS:=’1′ else SS:=’0′;
BINER := SS+BINER;

S := D MOD 2;
D := (D-S) div 2;
if (S = 1) then SS:=’1′ else SS:=’0′;
BINER := SS+BINER;

S := D MOD 2;
D := (D-S) div 2;
if (S = 1) then SS:=’1′ else SS:=’0′;
BINER := SS+BINER;

WRITE(BINER)

END.

=====================

Program Sisabagi;
uses crt;

var
D, S  : Integer;
SS    : STRING[1];
BINER : STRING[40];

BEGIN

REPEAT
BEGIN
CLRSCR;
WRITE (‘BILANGAN DESIMAL Positif : ‘);READLN(D);
END;
UNTIL (D >= 0 );

BINER := ”;

REPEAT
BEGIN
S := D MOD 2;
D := D div 2;
if (S = 1) then SS:=’1′ else SS:=’0’;
BINER := SS+BINER;
END;
UNTIL (D = 0) ;

WRITELN(‘BILANGAN BINER : ‘,BINER);
write(”);

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