summaryrefslogtreecommitdiff
path: root/3836/CH2/EX2.1/Ex2_1.sce
blob: d1c5cfc733f6c380cc442a8487f6396bd4fc7203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
clear
//Initialisation
v1=15.8                 //voltage across r1
v2=12.3                 //voltage across r2
r2=220                  //resistance R2 in ohm

//Calculation
v=v1-v2                 //voltage difference across the resistor
i=v/r2                  //current in ampere

//Result
printf("\n Current, I = %.1f mA",i*1000)