blob: 9d001f1a7def4e1e3e4e914ba3696b7327f2f85f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
clear//
//Variables
V = 6 //Voltage (in volts)
R1 = 1 //Resistance (in ohm)
R2 = 2 //Resistance (in ohm)
R3 = 3 //Resistance (in ohm)
//Case (a):
//Calculation
RT = R1 + R2 + R3 //Equivalent Resistance (in ohm)
I = V / RT //Current (in Ampere)
P = I**2 * RT //Power dissipated (in watt)
//Result
printf("\n Power dissipated in the entire circuit is %0.3f W.",P)
//Case (b):
//Calculation
RT = R1 + R2 //Equivalent Resistance (in ohm)
I = V / RT //Current (in Ampere)
P = I**2 * RT //Power dissipated (in watt)
//Result
printf("\n Power dissipated in the circuit when R2 is shortened is %0.3f W.",P)
//Case (c):
//Calculation
R = R1 //Resistance (in ohm)
I = V / R //Current (in Ampere)
P = I**2 * R //Power dissipated (in watt)
printf("\n Power dissipated in the circuit when R3 and R2 is shortened is %0.3f W.",P)
|