using System;
public class Program
{
static private double travisscott(double x, double y)
double astro = x * x;
double world = y * y;
return Math.Sqrt(astro - world);
}
static private double liluzi(double x, double z)
double pinktape = z * z;
return Math.Sqrt(astro + pinktape);
public static void Main()
start:
Console.WriteLine("Would you like to find the hypotenuse or a missing leg of a right triangle?");
Console.WriteLine("If you would like to find the hypotenuse press H if you want to find the missing leg press M");
string choice = Console.ReadLine();
if (choice == "M")
Console.WriteLine("enter the length of the leg");
double legs = double.Parse(Console.ReadLine());
Console.WriteLine("enter the length of the hypotenuse");
double hypo = double.Parse(Console.ReadLine());
if (hypo < legs)
Console.WriteLine("This is impossible becuase the leg is bigger thna the hypotenuse try again please");
Console.ReadLine();
Console.Clear();
goto start;
else
double answer = travisscott(hypo, legs);
Console.WriteLine("The leg is " + answer);
else if (choice == "H")
Console.WriteLine("Enter what you want the length of the legs to be");
double snipper = double.Parse(Console.ReadLine());
double hyposn = double.Parse(Console.ReadLine());
double answeryes = liluzi(snipper, hyposn);
Console.WriteLine("The hypotenuse is: " + answeryes);
Console.WriteLine("please reenter with proper numbers");
Console.WriteLine("Would you like to run the program again? y/n");
string cool = Console.ReadLine();
if (cool == "y" || cool == "Y")
if (cool == "n" || cool == "N")