static void Main(string[] args)
{
int answer;
Console.WriteLine("Enter two numbers separated by a space");
string[] str_inputs = Console.ReadLine().Split(' '
;
int[] inputs = new int[2];
for (int i = 0; i < inputs.Length; ++i)
inputs[i] = Convert.ToInt32(str_inputs[i]);
Console.WriteLine("Tell me what type of operation you would like to use");
string operation = Console.ReadLine();
if (operation == "Addition")
{
AddTwoNumbers(out answer, inputs[0], inputs[1]);
}
else
{
if (operation == "Add")
{
AddTwoNumbers(out answer, inputs[0], inputs[1]);
}
if (operation == "Sum")
{
AddTwoNumbers(out answer, inputs[0], inputs[1]);
}
}
Console.WriteLine(answer);
Console.ReadKey();
}
static void AddTwoNumbers(out int answer, int num1, int num2)
{
answer = (num1 + num2);
}
static void Main(string[] args)
{
int answer;
Console.WriteLine("Enter two numbers separated by a space");
string[] str_inputs = Console.ReadLine().Split(' '
;
int[] inputs = new int[2];
for (int i = 0; i < inputs.Length; ++i)
inputs[i] = Convert.ToInt32(str_inputs[i]);
Console.WriteLine("Tell me what type of operation you would like to use");
string operation = Console.ReadLine();
if (operation == "Addition")
{
goto AddingBlock;
}
else
{
if (operation == "Add")
{
goto AddingBlock;
}
if (operation == "Sum")
{
goto AddingBlock;
}
}
AddingBlock:
answer = (inputs[0] + inputs[1]);
Console.WriteLine(answer);
Console.ReadKey();
}
static void Main(string[] args)
{
int answer;
Console.WriteLine("Enter two numbers separated by a space");
string[] str_inputs = Console.ReadLine().Split(' '
;
int[] inputs = new int[2];
for (int i = 0; i < inputs.Length; ++i)
inputs[i] = Convert.ToInt32(str_inputs[i]);
Console.WriteLine("Tell me what type of operation you would like to use");
string operation = Console.ReadLine();
if (operation == "Addition")
{
AddTwoNumbers(out answer, inputs[0], inputs[1]);
}
else
{
if (operation == "Add")
{
AddTwoNumbers(out answer, inputs[0], inputs[1]);
}
if (operation == "Sum")
{
AddTwoNumbers(out answer, inputs[0], inputs[1]);
}
}
Console.WriteLine(answer);
Console.ReadKey();
}
static void AddTwoNumbers(out int answer, int num1, int num2)
{
answer = (num1 + num2);
}
static void Main(string[] args)
{
int answer;
Console.WriteLine("Enter two numbers separated by a space");
string[] str_inputs = Console.ReadLine().Split(' '
;
int[] inputs = new int[2];
for (int i = 0; i < inputs.Length; ++i)
inputs[i] = Convert.ToInt32(str_inputs[i]);
Console.WriteLine("Tell me what type of operation you would like to use");
string operation = Console.ReadLine();
if (operation == "Addition")
{
goto AddingBlock;
}
else
{
if (operation == "Add")
{
goto AddingBlock;
}
if (operation == "Sum")
{
goto AddingBlock;
}
}
AddingBlock:
answer = (inputs[0] + inputs[1]);
Console.WriteLine(answer);
Console.ReadKey();
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.