Skip to content

Instantly share code, notes, and snippets.

@kindawg98
Created January 23, 2018 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kindawg98/170c7665089704e433c13c40e8c4bc62 to your computer and use it in GitHub Desktop.
Save kindawg98/170c7665089704e433c13c40e8c4bc62 to your computer and use it in GitHub Desktop.
New code
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