LAB-03 Logical Operations I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals
ICS101-LAB03-Term063 2 Logical Operators By the order of precedence:.NOT..AND..OR.
ICS101-LAB03-Term063 3 Relational Operators Returns logical value (.TRUE. Or.FALSE.).EQ..NE..GT..GE..LT..LE. Their precedence are lower than arithmetic operations.
ICS101-LAB03-Term063 4 Exercise-1 Write a program that evaluates the following expressions: X > 7 X < 10 4 <= X <= > X >= > X > 50 (X > 8) AND (Y >= 19)
ICS101-LAB03-Term063 5 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-Term063 6 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