PROGRAM testlogical

!-- use parenthesis to change order of evaluation of sub-expressions

   IMPLICIT NONE

   LOGICAL :: tst1=.TRUE., tst2=.TRUE., tst3=.FALSE.
   LOGICAL :: ans1,ans2,ans3

   ans1 = tst1 .OR. tst2 .AND. tst3
   ans2 = (tst1 .OR. tst2) .AND. tst3
   ans3 = tst1 .OR. (tst2 .AND. tst3)

   PRINT*, ans1,ans2,ans3

END PROGRAM testlogical
