summaryrefslogtreecommitdiff
path: root/1241/CH2/EX2.24/exa2_24.sce
blob: 123130a73bc3197d258b9c30befe0bb165722429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//Example 2-24//
//Hexadecimal Subtraction//
clc
//clears the console//
clear
//clears all existing variables//
x=hex2dec('1273')
y=hex2dec('3A8')
//Decimal conversion of the hexadecimal numbers//
z=x-y
//addition//
a=dec2hex(z)
//decimal to hexadecimal conversion//
disp(' addition of the 2 hexadecimal numbers is ')
disp(a)
//answer in hexadecimal form//