LAB-03 Logical Operations I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals
ICS101-LAB03-Term073 2 Logical Operators By the order of precedence:.NOT..AND..OR.
ICS101-LAB03-Term073 3 Truth Table PQP.AND.QP.OR.Q.NOT.P.TRUE..FALSE..TRUE..FALSE..TRUE..FALSE..TRUE..FALSE..TRUE..FALSE..TRUE.
ICS101-LAB03-Term073 4 Relational Operators Returns logical value (.TRUE. Or.FALSE.).EQ..NE..GT..GE..LT..LE. Their precedence are lower than arithmetic operations.
ICS101-LAB03-Term073 5 Exercise-1 Write a program that reads inputs X and Y. Then, it evaluates the following expressions: X > 7 X < 10 4 <= X <= > X >= > X > 50 (X > 8) AND (Y >= 19)
ICS101-LAB03-Term073 6 Exercise-2 REAL X, Y LOGICAL TEST X= 1.0/3.0 Y= X*3.0 TEST = (Y.EQ. 1.0) PRINT *, "IT IS ", TEST, " THAT ", Y, " = ", 1.0 TEST = (X.EQ ) PRINT *, "IT IS ", TEST, " THAT ", X, " = ", END
ICS101-LAB03-Term073 7 Exercise-3 Write a program to test the following equivalences:.NOT.(A.GT. B.AND. B.LT. C) A.LE. B.OR. B.GE. C