Can someone please help me with the code to this programe:
Make a program that converts a positive integer to its binary form. It is enough that the program is capable of converting a 4 digit number. examples of print: The number 123 in binary form is 111 1011, number 256 in binary form is 1 0000 0000.
Thanks!
Do you know the algorithm for converting decimal to binary?
What code do you have so far?
Well, you need to be able to get the number you want to convert from the user.
Then you need to convert it to binary (I would store it in a string).
Then you need to output the string.
These links will help with step 2:
Binary numeral system - Wikipedia, the free encyclopedia
Implementation of a base conversion algorithm from Interactive Mathematics Miscellany and Puzzles
[QUOTE=WingedPanther;122603]Well, you need to be able to get the number you want to convert from the user.
Then you need to convert it to binary (I would store it in a string).
Then you need to output the string.
Thanks, but I really need help with the code
I won't give you the solution. Can you get input? Can you produce output?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks