blob: a0f263d985a7a803d74d4d53672466f9fb1b5e1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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) =")
|