Skip to content

Instantly share code, notes, and snippets.

@cbcwebdev
Created March 22, 2012 03:54
Show Gist options
  • Save cbcwebdev/2155663 to your computer and use it in GitHub Desktop.
Save cbcwebdev/2155663 to your computer and use it in GitHub Desktop.
Bad Way
public static void Main()
{
while(true) {
Console.WriteLine("Provide 2 numbers and I'll add them for you!");
var input = Console.ReadLine();
if(!string.IsNullOrEmpty(input))
{
var segments = input.Split(' ');
var operandOne = Convert.ToInt32(segments[0]);
var operandTwo = Convert.ToInt32(segments[1]);
Console.WriteLine(operandOne + operandTwo);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment