Created
March 22, 2012 03:54
-
-
Save cbcwebdev/2155663 to your computer and use it in GitHub Desktop.
Bad Way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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