summaryrefslogtreecommitdiff
path: root/608/CH5/EX5.07/5_07.sce
blob: 4a9da6f33b2c56782104a08d9374e640abf3b228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//Problem 5.07: Two resistors, of resistance 3 ohms and 6 ohms, are connected in parallel across a battery having a voltage of 12 V. Determine (a) the total circuit resistance and (b) the current flowing in the 3 ohms resistor.

//initializing the variables:
R1 = 3; // in ohms
R2 = 6; // in ohms
Vt = 12; // in volts

//calculation:
Rt = R1*R2/[R1 + R2]
I1 = [Vt/R1]

printf("\n\nResult\n\n")
printf("\n (a)Total Resistance %.0f Ohms",Rt)
printf("\n (b)Current(I1) %.0f Amperes(A)\n",I1)