blob: 102a97870e254bc125a8e46b77cb3f818c808598 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
clear//
//Variables
I = 1 //Current (in Ampere)
//Calculation
//Applying Kirchoff's voltage law:
//(1 *3) + (1 * R) + (1 * 4) - 12 =0
R = 5 //Resistance (in ohm)
//Result
printf("\n Value of R is %0.3f ohm.",R)
|