Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Answer: How do I convert between decimal and binary?

by Anonymous Monk
on Apr 05, 2013 at 04:42 UTC ( [id://1027063]=note: print w/replies, xml ) Need Help??


in reply to Re: Answer: How do I convert between decimal and binary?
in thread How do I convert between decimal and binary?

#!/user/local/bin/perl print "\nEnter the num:"; @rem=(); $dec =<STDIN>; print "converting to binary"; while ($dec> 0) { @rem$i++ = $dec % 2; $dec= int ($dec/2); } print reverse(@rem);
  • Comment on Re^2: Answer: How do I convert between decimal and binary?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1027063]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-23 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found