blob: 061bad0e0244b95b90e1d7daaab7c6d03f9a92da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
clear//
//Variables
l = 120 //length of wire (in meter)
d = 0.25 * 10**-2 //Diameter of cross section (in meter)
p = 1.7 * 10**-8 //Resistivity (in ohm-meter)
//Calculation
r = d/2 //Radius of cross section (in meter)
A = %pi *r*r //Area of cross section (in metersquare)
R = p*l/A //Resistance (in ohm)
//Result
printf("\n Resistance of the wire is %0.3f ohm.",R)
|