Jump to content
PirateClub.hu

Tízes számrendszerből kettesbe


Altair222
 Share

Recommended Posts

Bocsi, de néma gyereknek anyja se érti a szavát :) Ha nem írod le milyen kritériumoknak kell megfelelnie, hogy is várod el, hogy valaki a jó megoldást adja meg neked? :P

 

Program Decimal_Binary;
Uses WinCrt;
Var
Dec,Deci: Integer;
Bin: String;
Begin
Write('Input Decimal Number: ');Readln(Dec);
Deci:=Dec;
Bin:='';
Repeat
If(Dec Mod 2 = 0) Then
 Bin:='0'+Bin
Else
 Bin:='1'+Bin;
Dec:=Dec Div 2;
Until Dec=0;
Writeln;
Writeln(Deci,' Decimal = ',Bin,' Binary');
End.

 

Nem tudok ugyan pascalban programozni, de ezt sikerült összeollóznom netről. Remélem megfelel.

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Hozzászólás a témához...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Jelenleg olvassa   0 members

    • No registered users viewing this page.
×
×
  • Create New...