RosettaCodeData/Task/Arithmetic-Integer/Elena/arithmetic-integer.elena

16 lines
495 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
import system'math;
import extensions;
2026-02-01 16:33:20 -08:00
public Program()
2023-07-01 11:58:00 -04:00
{
2025-08-11 18:05:26 -07:00
var a := Console.loadLineTo(new Integer());
var b := Console.loadLineTo(new Integer());
2023-07-01 11:58:00 -04:00
2025-08-11 18:05:26 -07:00
Console.printLine(a," + ",b," = ",a + b);
Console.printLine(a," - ",b," = ",a - b);
Console.printLine(a," * ",b," = ",a * b);
Console.printLine(a," / ",b," = ",a / b); // truncates towards 0
Console.printLine(a," % ",b," = ",a.mod(b)); // matches sign of first operand
Console.printLine(a," ^ ",b," = ",a ^ b);
2023-07-01 11:58:00 -04:00
}