summaryrefslogtreecommitdiff
path: root/3754/CH12/EX12.13/12_13.sce
blob: 39504a76d4bfb16e96db0df257d9b2a15adabc80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
clear//

//Variables

VS = 6                         //Source voltage (in volts)
VD1=0.7;VD2=0.7;
R = 1.5 * 10**3                //Resistance (in ohm)

//Calculation

I = (VS - VD1 - VD2)/R         //Current (in Ampere)

//Result

printf("\n Total current through the circuit is  %0.3f  mA." ,I * 10**3)