summaryrefslogtreecommitdiff
path: root/462/CH2/EX2.27.a/ex_2_27_a.sce
blob: a4e481608626ffa852b4bd0838eb8c5e34ee416a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//example 2.27 (a)//
//subtraction of octal numbers//
clc
//clears the screen//
clear
//clears already existing variables//
x=oct2dec('53')
//octal to decimal conversion//
y=oct2dec('37')
z=x-y
//subtraction//
a=dec2oct(z)
//decimal to octal conversion//
b=dec2bin(z)
//decimal to binary conversion//
disp('result of subtraction of given numbers in octal form is:')
disp(a)
//answer in octal form//
disp('result of subtraction of given numbers in binary form is:')
disp(b)
//answer in binary form//