Anonymous user
Arithmetic/Integer: Difference between revisions
→{{header|C sharp|C#}}: fixed parenthesis + removed error handling + minor edits
(→{{header|C sharp|C#}}: fixed parenthesis + removed error handling + minor edits) |
|||
Line 152:
class Program
{
static void Main(string[] args)
{
int a = Convert.ToInt32(args[0]);▼
int
▲ int a = Convert.ToInt32(args[0]);
Console.WriteLine("
Console.WriteLine("
Console.WriteLine("{0} to the power of {1} = {2}", a, b, Math.Pow(a, b));
▲ Console.WriteLine("a / b = {0}", a / b);
▲ Console.WriteLine("a % b = {0}", a % b);
▲ Console.WriteLine("a to the power of b = {0}", Math.Pow(a, b)(;
}</lang>
Sample output:
<lang>5 + 3 = 8
5 - 3 = 2
5 * 3 = 15
5 / 3 = 1
5 % 3 = 2
5 to the power of 3 = 125</lang>
=={{header|Chef}}==
|