Sha256: 0c349e9594dd95d710259e5f0c918925482d2c658f1f1b3d2a0cf13de75b5421

Contents?: true

Size: 598 Bytes

Versions: 10

Compression:

Stored size: 598 Bytes

Contents

using System;

class Program
{
    static void Main(string[] args)
    {
        int a = Convert.ToInt32(args[0]);
        int b = Convert.ToInt32(args[1]);

        Console.WriteLine("{0} + {1} = {2}", a, b, a + b);
        Console.WriteLine("{0} - {1} = {2}", a, b, a - b);
        Console.WriteLine("{0} * {1} = {2}", a, b, a * b);
        Console.WriteLine("{0} / {1} = {2}", a, b, a / b); // truncates towards 0
        Console.WriteLine("{0} % {1} = {2}", a, b, a % b); // matches sign of first operand
        Console.WriteLine("{0} to the power of {1} = {2}", a, b, Math.Pow(a, b));
    }
}

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/c_sharp|c#.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/c_sharp|c#.txt