Okay I've got a program that determines whether an integer entered is odd or even. I have the code written but I don't know how to get the integer entered into code. I've tried many things but none make the compiler happy.
Here is what I have:
The line which has the Convert.ToInt32 thing I know is wrong. I just don't know what to write.
Here is what I have:
C#:
private void buttonOK_Click(object sender, EventArgs e)
{
int x;
x = Convert.ToInt32(textBoxEnterInteger.Text());
if (x % 2 == 0)
labelAnswer.Text = "The number is even";
else
labelAnswer.Text = "The number is odd";
}
The line which has the Convert.ToInt32 thing I know is wrong. I just don't know what to write.