diff options
Diffstat (limited to '3808/CH4/EX4.3/Ex4_3.sce')
-rw-r--r-- | 3808/CH4/EX4.3/Ex4_3.sce | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/3808/CH4/EX4.3/Ex4_3.sce b/3808/CH4/EX4.3/Ex4_3.sce new file mode 100644 index 000000000..e6c936256 --- /dev/null +++ b/3808/CH4/EX4.3/Ex4_3.sce @@ -0,0 +1,17 @@ +//Chapter 04:Number Theory and Cryptography + +clc; +clear all; + +bin=[] +n=input("Enter the length of the binary number:") +dec=0 +disp("Enter the digits one by one") +for i =1:n + bin(i)=input(" ") +end +for i=1:n + dec=dec*2+bin(i) +end +disp(dec,"Decimal Equivalent") + |