laba

an anonymous user · June 30, 2020 · Fortran
program laba2
 real, parameter:: x1=-0.2, x2=0.2, dx=0.05
 x=x1
 5 if (x>0) then 
  a=1+sin(x)
  g=1+0.3*(x**2)
   else 
  a=cos(x)
  g=1-0.3*(x**2)
   end if
 fx=a*(exp(x)+log(abs(x+0.1)))+g*(a**2 +1)*sin(x)
 print*, x, fx
 x=x+dx 
 if (x<=x2) goto 5
end program laba2

Comments

Please sign up or log in to contribute to the discussion.