summaryrefslogtreecommitdiff
path: root/Working_Examples/293/CH2/EX2.1.c/eg2_1c.sce
diff options
context:
space:
mode:
Diffstat (limited to 'Working_Examples/293/CH2/EX2.1.c/eg2_1c.sce')
-rwxr-xr-xWorking_Examples/293/CH2/EX2.1.c/eg2_1c.sce15
1 files changed, 15 insertions, 0 deletions
diff --git a/Working_Examples/293/CH2/EX2.1.c/eg2_1c.sce b/Working_Examples/293/CH2/EX2.1.c/eg2_1c.sce
new file mode 100755
index 0000000..a0f263d
--- /dev/null
+++ b/Working_Examples/293/CH2/EX2.1.c/eg2_1c.sce
@@ -0,0 +1,15 @@
+//c - a
+R1 = 10; // first resistance in ohms
+ R2 = 5;
+I = 1; // current source
+V = I*R1; // voltage across R
+disp("c - a)")
+disp(V,"voltage across the resistor (in volts)=")
+disp(I,"current flowing through the resistor (in amps) =")
+
+//c - b
+Vr1 = I*R1; // voltage across R1
+Vr2 = I*R2; //voltage across R2
+disp("c - b)")
+disp(V,"voltage across the resistor (in volts)=")
+disp(I,"current flowing through the resistor (in amps) =") \ No newline at end of file