Created
January 23, 2018 00:00
-
-
Save kindawg98/170c7665089704e433c13c40e8c4bc62 to your computer and use it in GitHub Desktop.
New code
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using static System.Console; | |
using static System.Convert; | |
namespace Austin_Kinney_Assignment2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for(int i = 0; i<10; i++) | |
{ | |
Console.Write("First Number = "); | |
int one = int.Parse(Console.ReadLine()); | |
Console.Write("Second Number = "); | |
int two = int.Parse(Console.ReadLine()); | |
Console.WriteLine("Greatest of two: " + GetMax(one, two)); | |
ReadKey(); | |
} | |
} | |
public static int GetMax(int one, int two) | |
{ | |
if (one > two) | |
{ | |
return one; | |
} | |
else if (one < two) | |
{ | |
return two; | |
} | |
else | |
{ | |
throw new Exception("Whoops!"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment