What is the final value of the variable "ans" in the following FORTRAN:

x = 1.0
y = 2.0
ans=0.0
if(x.gt.0.0.and.y.lt.10.0.and..not.y.eq.1.0)then
   ans=1.0
   x=-1.0
else if (x.lt.0.0) then
   ans=2.0
else if (y.eq.2.0) then 
   ans=3.0
end if
end

0.0

1.0

2.0

3.0

no result due to syntax error in the IF statement


Back to the 201 Homepage or Next Question