Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 378 Bytes

File metadata and controls

30 lines (24 loc) · 378 Bytes

Addition

You can add any two ints using the + operator.

~void main() {
int x = 5;
// y will be 6
int y = x + 1;
// z will be 11
int z = x + y;

IO.println(x);
IO.println(y);
IO.println(z);
~}

Adding a negative number does the same thing as subtraction.

~void main() {
int x = 5;
// y will be 1
int y = x + -4;

IO.println(x);
IO.println(y);
~}