program iftest integer :: x = -2 if (x) 10,20,30 10 print *,"x is negative!" goto 40 20 print *,"x is zero!" goto 40 30 print *,"x is positive!" 40 print *,"end transmission." end program iftest |
program iftest integer :: x = -2 if(x< 0) then goto 10 else if(x == 0) then goto 20 else goto 30 end if 10 print *,"x is negative!" goto 40 20 print *,"x is zero!" goto 40 30 print *,"x is positive!" 40 print *,"end transmission." end program iftest |