Presentation is loading. Please wait.

Presentation is loading. Please wait.

LAB-03 Logical Operations I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum.

Similar presentations


Presentation on theme: "LAB-03 Logical Operations I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum."— Presentation transcript:

1 LAB-03 Logical Operations I Putu Danu Raharja raharja @kfupm.edu.sa Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals

2 ICS101-LAB03-Term063 2 Logical Operators By the order of precedence:.NOT..AND..OR.

3 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.

4 ICS101-LAB03-Term063 4 Exercise-1 Write a program that evaluates the following expressions: X > 7 X < 10 4 <= X <= 10 20 > X >= 10 30 > X > 50 (X > 8) AND (Y >= 19)

5 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. 0.3333) PRINT *, “IT IS “, ‘ ‘, TEST, “ THAT “, X, “ = “, 0.3333 END

6 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


Download ppt "LAB-03 Logical Operations I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum."

Similar presentations


Ads by Google