@@ -0,0 +1,572 @@
+public class DecimalToBinary %7B%0A%0A    private static long toBinary(int num) %7B%0A%0A        if (num == 0)%7B%0A            return 0;%0A        %7D%0A%0A        if (num %3C 0) %7B%0A            throw new RuntimeException(%22Not a positive number%22);%0A        %7D%0A%0A        int binary = 0;%0A        int digit = 1;%0A%0A        while (num %3E 0) %7B%0A            int remainder = num %25 2;%0A            num /= 2;%0A            binary += remainder * digit;%0A            digit *= 10;%0A        %7D%0A%0A        return binary;%0A%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        System.out.println(toBinary(123));%0A%0A    %7D%0A%0A%7D%0A

Create DecimalToBinary