text: # (Logical Operations)
  
  Objectives
  
  • Logical Operators
  
  • Relational Operators
  
  • Logical Expressions
  
  Logical Operators
  
  .AND            .OR.              .NOT.
  
  Examples
  
   P Q P .AND. Q P .OR. Q .NOT. P .FALSE. .FALSE. .FALSE. .FALSE. .TRUE. .FALSE. .TRUE. .FALSE. .TRUE. .TRUE. .TRUE. .FALSE. .FALSE. .TRUE. .FALSE. .TRUE. .TRUE. .TRUE. .TRUE. .FALSE.
  
  Priority of Logical Operators
  
  1. .NOT.
  
  2. .AND.
  
  3. .OR.
  
  Relational Operators
  
   Operator Meaning Example .LT. Less than X  .LT.  Y .LE. Less than or equal to Y  .LE.  Z .EQ. Equal to A  .EQ.  B .NE. Not equal to A  .NE.  C .GT. Greater than B  .GT.  D .GE. Greater than or equal to D  .GE.  F
  
  Examples
  
  If A = 4.7, B = 4.3 and  C = 3.4
  
  A .GT. B    evaluates to .TRUE.
  
  B .LT. C     evaluates to .FALSE.
  
  Logical Expressions
  
  Example
  
  Given that X has a value of 3.0, Y has a value of  5.0, Z has a value of 10.0, and FLAG
  
  is a logical variable with .FALSE. Value,  evaluate the following FORTRAN expression:
  
  GOAL = .NOT. FLAG .AND. X*Y .GT. Z .OR. X + Y .GT. Z
  
  Exercise 1
  
  A > 5
  
  B < 8
  
  9 <= X <= 15
  
  18 > Y >= 12
  
  17 > Z > 33
  
  (X > 6) AND (Y >= 14)
  
  ###### Exercise 2
  
  Complete the following program by making the assignment:
  
  GOAL = .NOT. FLAG .AND. X*Y .GT. Z .OR. X + Y .GT. Z
  
  X = 4.5 , Y= 6.5 , Z = 11.0
  
  LOGICAL  FLAG , GOAL
  
  REAL  X, Y, Z
  
  FLAG = .FALSE.
  
  X  =  ---------------
  
  Y  =  ---------------
  
  Z  =  ---------------
  
  PRINT*, ' THE OUTPUT IS = ' , GOAL
  
  END
  
  Exercise 3
  
  Complete the following program by making the assignment:
  
  GOAL = X*Z .EQ. 20.0  .OR. FLAG .AND. .NOT. Z .EQ. 25.0
  
  X = 5.5 , Z = 12.0 , FLAG = .FALSE.
  
  LOGICAL   -------------------------------
  
  REAL         -------------------------------
  
  GOAL =      -------------------------------
  
  PRINT*, ' THE OUTPUT IS = ' , ------------------
  
  END
explanation: The document is a set of educational materials focused on logical and relational operators in the context of programming, specifically FORTRAN. It includes examples of logical operators, relational operators, and logical expressions. The document also contains exercises that require the reader to evaluate and complete code snippets. These exercises involve logical and relational expressions but do not explicitly ask a question or provide an answer.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # (Logical Operations)
  
  Objectives
  
  • Logical Operators
  
  • Relational Operators
  
  • Logical Expressions
  
  Logical Operators
  
  .AND            .OR.              .NOT.
  
  Examples
  
   P Q P .AND. Q P .OR. Q .NOT. P .FALSE. .FALSE. .FALSE. .FALSE. .TRUE. .FALSE. .TRUE. .FALSE. .TRUE. .TRUE. .TRUE. .FALSE. .FALSE. .TRUE. .FALSE. .TRUE. .TRUE. .TRUE. .TRUE. .FALSE.
  
  Priority of Logical Operators
  
  1. .NOT.
  
  2. .AND.
  
  3. .OR.
  
  Relational Operators
  
   Operator Meaning Example .LT. Less than X  .LT.  Y .LE. Less than or equal to Y  .LE.  Z .EQ. Equal to A  .EQ.  B .NE. Not equal to A  .NE.  C .GT. Greater than B  .GT.  D .GE. Greater than or equal to D  .GE.  F
  
  Examples
  
  If A = 4.7, B = 4.3 and  C = 3.4
  
  A .GT. B    evaluates to .TRUE.
  
  B .LT. C     evaluates to .FALSE.
  
  Logical Expressions
  
  Example
  
  Given that X has a value of 3.0, Y has a value of  5.0, Z has a value of 10.0, and FLAG
  
  is a logical variable with .FALSE. Value,  evaluate the following FORTRAN expression:
  
  GOAL = .NOT. FLAG .AND. X*Y .GT. Z .OR. X + Y .GT. Z
  
  Exercise 1
  
  A > 5
  
  B < 8
  
  9 <= X <= 15
  
  18 > Y >= 12
  
  17 > Z > 33
  
  (X > 6) AND (Y >= 14)
  
  ###### Exercise 2
  
  Complete the following program by making the assignment:
  
  GOAL = .NOT. FLAG .AND. X*Y .GT. Z .OR. X + Y .GT. Z
  
  X = 4.5 , Y= 6.5 , Z = 11.0
  
  LOGICAL  FLAG , GOAL
  
  REAL  X, Y, Z
  
  FLAG = .FALSE.
  
  X  =  ---------------
  
  Y  =  ---------------
  
  Z  =  ---------------
  
  PRINT*, ' THE OUTPUT IS = ' , GOAL
  
  END
  
  Exercise 3
  
  Complete the following program by making the assignment:
  
  GOAL = X*Z .EQ. 20.0  .OR. FLAG .AND. .NOT. Z .EQ. 25.0
  
  X = 5.5 , Z = 12.0 , FLAG = .FALSE.
  
  LOGICAL   -------------------------------
  
  REAL         -------------------------------
  
  GOAL =      -------------------------------
  
  PRINT*, ' THE OUTPUT IS = ' , ------------------
  
  END
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The document is a set of educational materials focused on logical and relational operators in the context of programming, specifically FORTRAN. It includes examples of logical operators, relational operators, and logical expressions. The document also contains exercises that require the reader to evaluate and complete code snippets. These exercises involve logical and relational expressions but do not explicitly ask a question or provide an answer.
  
  Label: no-question