Copyright © tutorialspoint.com

Euphoria - Arithmatic Operators

previous next


Advertisements

The following simple example program demonstrates the arithmetic operators. Copy and paste following Euphoria program in test.ex file and run this program:

#!/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, "b / a = %d\n" , (b / a) )
printf(1, "+a   = %d\n" ,  (+a) )
printf(1, "-a   = %d\n" ,  (-a) )

This would produce following result:

a + b = 30
a - b = -10
a * b = 200
b / a = 2
+a   = 10
-a   = -10

Note: Euphoria supports all the above operations for other Euphoria data types e.g. sequence, atoms and objects.


previous next

Copyright © tutorialspoint.com