Euphoria 賦值運算子


下面的簡單範例程式演示了賦值運算子。複製並貼上以下Euphoria 程式在test.ex檔案並執行這個程式:

#!/home/euphoria-4.0b2/bin/eui

integer a = 10
integer b = 20
integer c = 0

c = a + b
printf(1, "c = a + b = %d\n", c )

c += a 
printf(1, "c += a = %d\n", c )

c -= a 
printf(1, "c -= a = %d\n", c )

c *= a 
printf(1, "c *= a = %d\n", c )

a = 10
c = 30
c /= a 
printf(1, "c /= a = %d\n", c )

這將產生以下結果:

c = a + b = 30
c += a = 40
c -= a = 30
c *= a = 300
c /= a = 3

註: 其他的Euphoria 資料型別例如Euphoria 支援所有上述操作序列,原子和物件。