OVERDIV - Contoh Program Konversi Bilangan Biner ke Desimal (Decimal) Pascal menggunakan Turbo Pascal for Windows 1.5 (TPW 1.5)
Bagi yang belum punya TPW 1.5, silahkan download aplikasinya disini >>
BERIKUT CODING PROGRAMNYA :
program bintodes;
uses wincrt;
function pkt(X :real;n : integer):real;
var
t : real;
m : integer;
begin
m:=abs(n);
if (x<>0) and (n=0) then pkt:=1
else if n >0 then
pkt:=x*pkt(x,n-1)
else if (n < 0) then pkt := 1/(x*pkt(x,m-1));
end;
var
bin: string;
i,x:integer;
des:real;
begin
clrscr;
des:=0;
repeat
writeln('Konversi Bilangan Biner Ke Desimal');
writeln('==================================');
writeln;
writeln('Bilangan Biner (16 digit) : ');readln(bin);
if length(bin) > 16 then
begin
clrscr;
gotoxy(18,27);writeln('Digit nilai yang anda masukkan melebihi 16.');gotoxy(1,1);
end;
until length(bin) <= 16;
for i:= 1 to 16 do
begin
case i of
1: x:=16;2: x:=15;3: x:=14;4: x:=13;5: x:=12;6: x:=11;7: x:=10;8: x:=9;
9: x:=8;10: x:=7;11: x:=6;12: x:=5;13: x:=4;14: x:=3;15: x:=2;16: x:=1;
end;
if bin[i] = '1' then
des:= des + pkt(2,x-1);
if bin[i] = '0' then des:= des + 0;
end;
clrscr;
writeln('Hasil Konversi');
writeln('==============');
writeln;
writeln(bin,' (biner) = ',des:0:0,' (desimal)');
end.
SCREENSHOT :
SEMOGA BERMANFAAT :)
Ga bisa om code pascalnya
ReplyDeleteProgram Konversi Bilangan Biner Ke Desimal Pascal >>>>> Download Now
ReplyDelete>>>>> Download Full
Program Konversi Bilangan Biner Ke Desimal Pascal >>>>> Download LINK
>>>>> Download Now
Program Konversi Bilangan Biner Ke Desimal Pascal >>>>> Download Full
>>>>> Download LINK