Remove Arithmetic If  Statement

Description:  replace an old arithmetic If statement, with an equivalent If construct containing Go To.

State: Implemeted         Author: Matthew Fotzler      Version:  Submission Process

Code Example:

   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


ScreenShots

          

HTML Comment Box is loading comments...