2
I’m not getting the calculator to take the root of a number that the user types. The most I got was what is in the code, but regardless of the screen value, it only returns the root value of 2 (1,412...) or root of any pre-defined value in the code. I want the program to take the root of the value on the screen.
private void buttonRaiz_Click(object sender, EventArgs e)
{
double label1 = 2;
double resutado = Convert.ToSingle(Math.Sqrt(label1));
Tela.Text = resutado.ToString();
}
Tela.Text
is the name of the calculator screen. label1.Text
is the name of a label that I use on the calculator screen to store the numbers. I can only put label1
, if by label1.Text
error of variable types.