blob: 07673fd561e5dbadeb67c28176adf1925fc968a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//Given that
n = 250
A = 2.52*10^-4 //in m^2
i = 100*10^-6 //in A
B = 0.85 //in T
//Sample Problem 29-8
printf("**Sample Problem 29-8**\n")
mu = n*i*A
U1 = -mu*B*cos(%pi/2)
U2 = -mu*B*cos(0)
W = U1 - U2
printf("Work done is equal to %eJ", W)
|