Binary Number Conversion
E · easyP · Verified PYQmath
Problem
Given a decimal number N, convert it to binary representation. (TCS also asks: decimal to octal, decimal to hexadecimal — practice all three.)
Example
Input
10
Output
1010
Repeatedly divide by 2, collect remainders. Print remainders in reverse.