summaryrefslogtreecommitdiff
path: root/3836/CH9/EX9.9/Ex9_9.sce
blob: 2d15c1464532d2443bb8530dc3b507dc997675b7 (plain)
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)