blob: bb04bbe662a8ff3daf9dd9272b329efaafdd7365 (
plain)
1
2
3
4
5
6
7
|
//Example 24.1. convert decimal 12 to an octal number
clc
o=dec2oct(12)
disp("The procedure is as follows.")
disp("12 divided by 8 = quotient 1 with a remainder of 4")
disp(" 1 divided by 8 = quotient 0 with a remainder of 1")
disp(o,"Therefore, decimal 12 = octal")
|