1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
clear //Initialization ni=26 //Decimal number //Calculation bini = 0 i = 1 while (ni > 0) rem = ni-int(ni/2)*2 ni = int(ni/2) bini = bini + rem*i i = i * 10 end w= bini //Declaration printf("\n Binary Equivalent = %d",w)