summaryrefslogtreecommitdiff
path: root/273/CH25/EX25.2
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /273/CH25/EX25.2
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '273/CH25/EX25.2')
-rwxr-xr-x273/CH25/EX25.2/ex25_2.sce13
1 files changed, 13 insertions, 0 deletions
diff --git a/273/CH25/EX25.2/ex25_2.sce b/273/CH25/EX25.2/ex25_2.sce
new file mode 100755
index 000000000..e77f5a459
--- /dev/null
+++ b/273/CH25/EX25.2/ex25_2.sce
@@ -0,0 +1,13 @@
+clc;
+clear;
+//example 25.2
+//addition of binary numbers
+
+a=1010.00; //first number
+b=0011.11; //second number
+A=bin21dec(a); //converting a in to decimal number
+B=bin21dec(b); //converting b in to decimal number
+S=A+B; //adding the two decimal numbers
+temp=dec21bin(S); //converting the decimal sum back to binary
+format('v',10); //changing the default precision to 8
+disp(temp,'sum is'); //displaying the final output \ No newline at end of file