I am also a New Learner, Base on the Request, This Simple Code would detect if a Number is Even or ODD number....
// This is to Detect Odd and Even Number
bool ValidateDegreeValue; // This is to Validate that the User Enter Number Data
double DegreeValueNum; // This Define the Length of the Number that the User can Enter
// The below Code will notify the User if the data enter is not Numerical
ValidateDegreeValue = double.TryParse(txtDegreeValue.Text, out DegreeValueNum);
if (ValidateDegreeValue == false)
{
MessageBox.Show("Enter Valid Temperature Value", "Input Error");
txtDegreeValue.Focus();
return;
}
if (DegreeValueNum % 2 == 0)
{
txtNumClass.Text = DegreeValueNum.ToString() + " Is an Even Number";
}
else
{
txtNumClass.Text = DegreeValueNum.ToString() + " Is an Odd Number";
}