Arithmetic/Integer: Difference between revisions
Content added Content deleted
m (Changed over to headers.) |
No edit summary |
||
Line 61: | Line 61: | ||
std::cout << "a/b = " << a/b << ", remainder " << a%b << "\n"; |
std::cout << "a/b = " << a/b << ", remainder " << a%b << "\n"; |
||
return 0; |
return 0; |
||
} |
|||
=={{header|C#}}== |
|||
using System; |
|||
class Program |
|||
{ |
|||
static void Main(string[] args) |
|||
{ |
|||
int a, b; |
|||
if (args.Length < 2) |
|||
return; |
|||
b = Convert.ToInt32(args[1]); |
|||
if (b == 0) |
|||
return; |
|||
a = Convert.ToInt32(args[0]); |
|||
Console.WriteLine("a + b = {0}", a + b); |
|||
Console.WriteLine("a - b = {0}", a - b); |
|||
Console.WriteLine("a * b = {0}", a * b); |
|||
Console.WriteLine("a / b = {0}", a / b); |
|||
Console.WriteLine("a % b = {0}", a % b); |
|||
} |
|||
} |
} |
||