PROGRAM testlogical

!-- logical expressions that involve both relational operators and logical operators

   IMPLICIT NONE

   REAL     :: height=1.85, weight=95.0
   INTEGER  :: age=55
   LOGICAL  :: drinker=.TRUE., employed=.TRUE., smoker=.TRUE.
   LOGICAL  :: test1,test2,test3

   IF (age > 50) PRINT*,"Over fifty"
   test1 = employed .AND. (age < 45)
   test2 = smoker .AND. drinker .AND. (height < 2.00)
   test3 = (.NOT. smoker .OR. (age <= 55) .AND. (weight > 50)) .AND. (height <= 1.84)

   PRINT*,test1,test2,test3

END PROGRAM testlogical
