
- Euphoria Tutorial
- Euphoria - Home
- Euphoria - Overview
- Euphoria - Environment
- Euphoria - Basic Syntax
- Euphoria - Variables
- Euphoria - Constants
- Euphoria - Data Types
- Euphoria - Operators
- Euphoria - Branching
- Euphoria - Loop Types
- Euphoria - Flow Control
- Euphoria - Short Circuit
- Euphoria - Sequences
- Euphoria - Date & Time
- Euphoria - Procedures
- Euphoria - Functions
- Euphoria - Files I/O
- Euphoria Useful Resources
- Euphoria - Quick Guide
- Euphoria - Library Routines
- Euphoria - Useful Resources
- Euphoria - Discussion
Euphoria - Logical Operators
The following simple example program demonstrates the logical operators. Copy and paste following Euphoria program in test.ex file and run this program −
#!/home/euphoria-4.0b2/bin/eui integer a = 1 integer b = 0 integer c = 1 printf(1, "a and b = %d\n", (a and b) ) printf(1, "a or b = %d\n", (a or b) ) printf(1, "a xor b = %d\n", (a xor b) ) printf(1, "a xor c = %d\n", (a xor c) ) printf(1, "not(a) = %d\n", not(a) ) printf(1, "not(b) = %d\n", not(b) )
This would produce the following result. Here 0 represents false and 1 represents true.
a and b = 0 a or b = 1 a xor b = 1 a xor c = 0 not(a) = 0 not(b) = 1
euphoria_operators.htm
Advertisements