Files
CSharp-learning/C# Full Course for free/7.hypotenuse_calculator.md

21 lines
408 B
Markdown

# hypotenuse calculator
in this project we will cover how to implement
the hypotenuse theorem
$$
\sqrt{a^2 + b^2} = c
$$
```C#
Console.Write("enter the length of A :");
double a = Convert.ToDouble(Console.ReadLine());
Console.Write("enter the length of B :");
double b = Convert.ToDouble(Console.ReadLine());
c = Math.Sqrt(Math.Pow(a,2) + Math.Pow(b,2))
Console.WriteLine("C is equal to : " + c);
```