summaryrefslogtreecommitdiff
path: root/608/CH2/EX2.12/2_12.sce
blob: cdd3a7a43aa4a6b0be8a528018ee64b672fc5054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//Problem 2.12: The current/voltage relationship for two resistors A and B is as shown in Figure 2.5. Determine the value of the resistance of each resistor.

//initializing the variables:
I1 = 0.020; // in ampere
V1 = 20; // in Volts
I2 = 0.005; // in ampere
V2 = 16; // in Volts

//calculation:
R1 = V1/I1
R2 = V2/I2

printf("\n\nResult\n\n")
printf("\nResistance(R1): %.0f Ohms",R1)
printf("\nResistance(R2): %.0f Ohms\n",R2)