static private double hyp(double a, double b)
return Math.Sqrt(a2 + b2);
static private double pyth(double a, double c)
public static void Main()
string restart = "This variable will let me quit the program";
Console.WriteLine("Enter 1 if you are missing the hypotenuse and 2 if you are missing a leg");
byte input = byte.Parse(Console.ReadLine());
Console.WriteLine("enter the length of leg 1");
double leg1 = double.Parse(Console.ReadLine());
Console.WriteLine("enter the lenth of leg 2");
double leg2 = double.Parse(Console.ReadLine());
Console.WriteLine("The hypotenuse is: " + hyp(leg1, leg2).ToString("##.##"));
Console.WriteLine("enter the length of your leg");
double leg = double.Parse(Console.ReadLine());
Console.WriteLine("enter the length of your hypotenuse");
double hyp = double.Parse(Console.ReadLine());
Console.WriteLine("The length of your missing leg is: " + pyth(leg,hyp).ToString("##.##"));
Console.WriteLine("You must enter 1 or 2");
Console.WriteLine("Press q to quit or press any other key to continue");
restart = Console.ReadLine();