From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1544/CH1/EX1.1/Ch01Ex1.sce | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 1544/CH1/EX1.1/Ch01Ex1.sce (limited to '1544/CH1/EX1.1/Ch01Ex1.sce') diff --git a/1544/CH1/EX1.1/Ch01Ex1.sce b/1544/CH1/EX1.1/Ch01Ex1.sce new file mode 100755 index 000000000..3b529e9ca --- /dev/null +++ b/1544/CH1/EX1.1/Ch01Ex1.sce @@ -0,0 +1,30 @@ +// Scilab code Ex1.1: Pg 3 (2008) +clc; clear; +I =.000018; // Electric current, A +V = 15000; // Electric potential, V +P = 250000000 // Electric Power, W +// Display standard form +printf("\nStandard form:"); +printf("\n=============="); +printf("\n%f A = %3.1e A", I, I); +printf("\n%5.0f V = %3.1e V", V, V); +printf("\n%9.0f W = %3.1e W", P, P); +// Display scientific notation +printf("\n\nScientific form:"); +printf("\n================"); +printf("\n%f A = %2d micro-ampere", I, I/1e-06); +printf("\n%5.0f V = %2d kilo-volt", V, V/1e+03); +printf("\n%9.0f W = %3d mega-watt", P, P/1e+06); + +// Result +// Standard form: +// ============== +// 0.000018 A = 1.8e-005 A +// 15000 V = 1.5e+004 V +// 250000000 W = 2.5e+008 W + +// Scientific form: +// ================ +// 0.000018 A = 18 micro-ampere +// 15000 V = 15 kilo-volt +// 250000000 W = 250 mega-watt -- cgit