summaryrefslogtreecommitdiff
path: root/45/CH14/EX14.3/example_14_3.sce
diff options
context:
space:
mode:
Diffstat (limited to '45/CH14/EX14.3/example_14_3.sce')
-rwxr-xr-x45/CH14/EX14.3/example_14_3.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/45/CH14/EX14.3/example_14_3.sce b/45/CH14/EX14.3/example_14_3.sce
new file mode 100755
index 000000000..0fdab6408
--- /dev/null
+++ b/45/CH14/EX14.3/example_14_3.sce
@@ -0,0 +1,22 @@
+//example 14.3
+clc;
+clear;
+close;
+v1 = input('Enter the value of V1 in volts :'); // taking the inpt voltage
+disp('CASE - a');// case a
+if (v1==0) then
+ disp('V2 = 5 V');
+ disp('I = 0 mA');
+ else
+ disp('V2 = 0 V')
+ disp('I = 5 mA ')
+end
+disp('CASE - b'); // case b
+if (v1==0) then
+ disp('V2 = 5 V')
+ disp('I = 5 mA' )
+else
+ disp('V2 = 0 V');
+ disp('I = 0 mA');
+
+end