program goto2
implicit none
integer :: A
A = 0

1 continue
write(*, *)
A = A + 1

if (A > 2) then
    go to 95
end if

write(*, *) "A =", A, "  Starting"
if (A == 1) then
    go to 10
end if
go to 20

10 continue
write(*, *) "A =", A, "  Got to 10"
go to 30

20 continue
write(*, *) "A =", A, "  Got to 20"

30 continue
write(*, *) "A =", A, "  Got to 30"
if (A == 2) then
    go to 99
end if
go to 1


95 continue
write(*, *) "A =", A, "  Got to 95"


99 continue
write(*, *) "A =", A, "  Got to 99"

stop " "
end program goto2
