|
Post by danuthorincas on Jun 12, 2020 4:53:48 GMT
I want to print only value of j and i with condition A<2.05 and A>2 and j+i =50
for j = 1 to 50
For i=1 to 50
X=i+j
If x<50 then
A=(1*i+2*j)/50
end if
If A<2.05 and A >2 then
PRINT i,j, A
End if
next
next
|
|
|
Post by B+ on Jun 12, 2020 7:00:47 GMT
Never going to get anything printed as stated. j+i will never = 50 with those conditions for A
'' I want to print only value of j and i with condition A<2.05 and A>2 and j+i =50
for j = 1 to 50 For i = 1 to 50 X = i + j A = (1 * i + 2 * j) / 50 If A < 2.05 and A >= 2 and j+i = 50 then PRINT i, j next next
|
|
|
Post by zzz000abc on Jun 18, 2020 16:23:18 GMT
Never going to get anything printed as stated. j+i will never = 50 with those conditions for A '' I want to print only value of j and i with condition A<2.05 and A>2 and j+i =50
for j = 1 to 50 For i = 1 to 50 X = i + j A = (1 * i + 2 * j) / 50 If A < 2.05 and A >= 2 and j+i = 50 then PRINT i, j next next
whether we write i or 1*i it makes no difference in the formula A=(1*i+2*j)/50 and the condition is never satisfied. so I guess the formula might be A=(1+i+2*i). I am rewriting the with slight alteration in the formula. for i = 1 to 50 j=50-i A = (1 + i + 2 * j) / 50 print i,j,A If A < 2.05 and A >= 2 and j+i = 50 then PRINT "conditions satisfied ";i, j next
|
|
|
Post by B+ on Jun 18, 2020 17:09:30 GMT
Never going to get anything printed as stated. j+i will never = 50 with those conditions for A '' I want to print only value of j and i with condition A<2.05 and A>2 and j+i =50
for j = 1 to 50 For i = 1 to 50 X = i + j A = (1 * i + 2 * j) / 50 If A < 2.05 and A >= 2 and j+i = 50 then PRINT i, j next next
whether we write i or 1*i it makes no difference in the formula A=(1*i+2*j)/50 and the condition is never satisfied. so I guess the formula might be A=(1+i+2*i). I am rewriting the with slight alteration in the formula. for i = 1 to 50 j=50-i A = (1 + i + 2 * j) / 50 print i,j,A If A < 2.05 and A >= 2 and j+i = 50 then PRINT "conditions satisfied ";i, j next
Nice one! maybe that's what he meant and it was a typo * instead of + that makes sense! I tried some alternate expressions myself but nothing came up as cleanly as this.
|
|