diff options
Diffstat (limited to '3808/CH4/EX4.6')
-rw-r--r-- | 3808/CH4/EX4.6/Ex4_6.sce | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/3808/CH4/EX4.6/Ex4_6.sce b/3808/CH4/EX4.6/Ex4_6.sce new file mode 100644 index 000000000..b21ef3a62 --- /dev/null +++ b/3808/CH4/EX4.6/Ex4_6.sce @@ -0,0 +1,17 @@ +//Chapter 04:Number Theory and Cryptography + +clc; +clear all; + +arr=[] +n=input("Enter the number:") +tn=n +while n~=0 + re=pmodulo(n,8) + n=int(n/8) + arr($+1)=re +end +mprintf("The octal equivalent of the decimal number %d is:",tn) +for i=length(arr):-1:1 + mprintf("%d",arr(i)) +end |