Skip to content

Integer arithmetic

CodingUnit edited this page Oct 21, 2011 · 8 revisions

Integer Arithmetic

Category: Arithmetic Description: This sample shows some basic integer arithmetic Code:

using Console;

SampleArithmetic1() : void
{
 def x = 5 + 8 - 3;
 def y = x * 3 + 5; 
 def (r1, r2) = (x / 3, x % 3);
 WriteLine($"x = $x, y = $y, r1 = $r1, r2 = $r2")
} 

Execution Result:

x = 10, y = 35, r1 = 3, r2 = 1

Clone this wiki locally