下面的簡單範例程式演示了關係運算子。複製並貼上以下Euphoria 程式在test.ex檔案並執行這個程式:
#!/home/euphoria-4.0b2/bin/eui integer a = 10 integer b = 20 printf(1, "a = b = %d\n", (a = b) ) printf(1, "a != b = %d\n", (a != b) ) printf(1, "a > b = %d\n", (a > b) ) printf(1, "a < b = %d\n", (a < b) ) printf(1, "b >= a = %d\n", (b >= a) ) printf(1, "b <= a = %d\n", (b <= a) ) |
這將產生下面的結果。這裡0表示false,1表示true:
a = b = 0 a != b = 1 a > b = 0 a < b = 1 b >= a = 1 b <= a = 0 |
註: 其他的Euphoria 資料型別例如Euphoria 支援所有上述操作序列,原子和物件。