summaryrefslogtreecommitdiff
path: root/1544/CH1/EX1.2/Ch01Ex2.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1544/CH1/EX1.2/Ch01Ex2.sce
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 '1544/CH1/EX1.2/Ch01Ex2.sce')
-rwxr-xr-x1544/CH1/EX1.2/Ch01Ex2.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/1544/CH1/EX1.2/Ch01Ex2.sce b/1544/CH1/EX1.2/Ch01Ex2.sce
new file mode 100755
index 000000000..f389dce03
--- /dev/null
+++ b/1544/CH1/EX1.2/Ch01Ex2.sce
@@ -0,0 +1,20 @@
+// Scilab code Ex1.2: Pg.4 (2008)
+clc; clear;
+I = 25e-05; // Electric Current,A
+P = 3e+04; // Electric Power, W
+W = 850000; // Work done, J
+V = 0.0016; // Electric Potential, V
+printf("\n\nScientific (Engineering) notation:");
+printf("\n===================================");
+printf("\n%2e A = %3d micro-ampere = %3.2f mA", I, I/1e-06, I/1e-03);
+printf("\n%1.0e W = %3d micro-watt", P, P/1e-06);
+printf("\n%6d J = %3d kJ = %3.2f MJ", W, W/1e+03, W/1e+06);
+printf("\n%5.4f V = %3.1f milli-volt", V, V/1e-03);
+
+// Result
+// Scientific (Engineering) notation:
+// ===================================
+//2.500000e-004 A = 250 micro-ampere = 0.25 mA
+// 3e+004 W = -64771072 micro-watt
+// 850000 J = 850 kJ = 0.85 MJ
+// 0.0016 V = 1.6 milli-volt