Binary Number Conversion

E · easyP · Verified PYQmath

Given a decimal number N, convert it to binary representation. (TCS also asks: decimal to octal, decimal to hexadecimal — practice all three.)

Input
10
Output
1010
Repeatedly divide by 2, collect remainders. Print remainders in reverse.
← BFS (Breadth First Search) on a GraphBinary Search (Sorted Array) →
Report an issue with this question