Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Arithmetic-Integer/C-sharp/arithmetic-integer.cs
Normal file
17
Task/Arithmetic-Integer/C-sharp/arithmetic-integer.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue