[ Outline ] · Standard · Linear+

> Pretvaranje decimalnog zapisa u binarni, Pascal

Laza_91
post May 27 2007, 06:38 PM
Post #1





Group: Članovi
Joined: 20-May 06
Member No.: 63



E jel moze neko da mi napise funkciju za prevodjenje broja iz dekadnog u binarni brojni sistem...
Do sutra...Ako je moguce sad.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topicStart Poll
Replies
pyost
post May 27 2007, 06:50 PM
Post #2


Deus Ex Makina
Group Icon

Group: Administratori
Joined: 25-January 06
From: Beograd
Member No.: 2
Status: Bivši učenik MGa
Škola/Razred: RAF



CODE
function decBin(broj:integer):integer;
var
  vrednost,mnozilac: integer;
begin
    vrednost:=0;
    mnozilac:=1;

    while broj<>0 do
    begin
         vrednost:=vrednost+(broj mod 2)*mnozilac;
         broj:=broj div 2;
         mnozilac:=mnozilac*10;
    end;

    decBin:=vrednost;
end;


--------------------
Baby, it's a violent world.

Registrovani korisnik Linuxa broj 460770 [Ubuntu 7.10]
User is offlineProfile CardPM
Go to the top of the page
+Quote Post



Reply to this topicTopic OptionsStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: