From f35ea80659b6a49d1bb2ce1d7d002583f3f40947 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:38:01 +0530 Subject: updated the code --- 293/CH2/EX2.1.c/eg2_1c.sce | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to '293/CH2') diff --git a/293/CH2/EX2.1.c/eg2_1c.sce b/293/CH2/EX2.1.c/eg2_1c.sce index 42a65d44e..a0f263d98 100755 --- a/293/CH2/EX2.1.c/eg2_1c.sce +++ b/293/CH2/EX2.1.c/eg2_1c.sce @@ -1,14 +1,15 @@ -//c - a -R1 = 10; // first resistance in ohms -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(Vr,"voltage across the resistor (in volts)=") +//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 -- cgit