summaryrefslogtreecommitdiff
path: root/243/CH3/EX3.2/3_02.sce
blob: 43a501ad4049d5d2fb0e368112a84a28bc020383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Example No. 3_02
//hexadecimal to decimal
//Pg No. 46
clear ; close ; clc ;

h = '12AF' ;
u = str2code(h)
u = abs(u)
n = length(u)
d = 0
for i = 1:n
    d = d*16 + u(i)
end
disp(d,'Decimal value = ')
//Using Scilab Function
d = hex2dec(h)
disp(d,'Using scilab function Decimal value = ')