summaryrefslogtreecommitdiff
path: root/3808/CH4/EX4.6/Ex4_6.sce
blob: b21ef3a6230151e1090858b233e1f221115b680a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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