Is there a way in C# for returning a square root of a number with decimals. Every time I use Math.Sqrt() it doesn't return a decimal.
My code:
Int32 a = Convert.ToInt32(input1.Text);
Int32 b = Convert.ToInt32(input2.Text);
//a*a + b*b = c*c
Int32 a2 = a * a;
Int32 b2 = b * b;
Int32 c2 = a2 + b2;
Int32 c = Convert.ToInt32(Math.Sqrt(c2));
output.Text = Convert.ToString(c);