public class Solution { public static void main(String[] args) { int dNum = 1264; String str = ""; while (dNum > 0) { int rem = dNum % 2; str = rem + str; dNum = dNum / 2; } System.out.println("Binary value is: " + str); } } OUTPUT: Binary value is: 10011110000