+ 9
[ASSIGNMENT] 🏅🏆Convert Decimal to Binary🏆🏅
Make a program that will convert the decimal number to a binary number. example: input = 6 output = 110 input = 3 output = 11 Here is my try in java: https://code.sololearn.com/cT6SXVU2euI8/?ref=app
17 Answers
+ 22
https://code.sololearn.com/chxRsKef9Z0Z/?ref=app
+ 18
https://code.sololearn.com/c4jFEuUDt0Kz/?ref=app
+ 14
Ruby: puts gets.to_i.to_s(2)
+ 9
Lol i just finished a code about this!
https://code.sololearn.com/coKLNTzAuZn1/?ref=app
+ 5
Python: print(bin(int(input()))[2:])
+ 3
JavaScript:
var a = parseInt(prompt("Enter your number:"));
alert(a.toString(2));
+ 2
https://code.sololearn.com/cyAev5qZwGLk/?ref=app
+ 2
heres mine 2 one liners
https://code.sololearn.com/c7hsrWaQTnzj/?ref=app
https://code.sololearn.com/c5o4dpJYj0e9/?ref=app
+ 1
https://code.sololearn.com/cvGYAsyjXv93/?ref=app
recursion
+ 1
made this one a while ago...
https://code.sololearn.com/WRwL3uYN4xTT/?ref=app
0
https://code.sololearn.com/cRK1twdIVa3Z/?ref=app