diff options
Diffstat (limited to '243/CH3/EX3.2/3_02.sce')
-rwxr-xr-x | 243/CH3/EX3.2/3_02.sce | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/243/CH3/EX3.2/3_02.sce b/243/CH3/EX3.2/3_02.sce new file mode 100755 index 000000000..43a501ad4 --- /dev/null +++ b/243/CH3/EX3.2/3_02.sce @@ -0,0 +1,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 = ')
\ No newline at end of file |