jae-l
5/9/2017 - 4:12 AM

Prints if the entered integer is an odd or even number.

Prints if the entered integer is an odd or even number.

Console.WriteLine("Enter a number: ");
int n = int.Parse(Console.ReadLine());

if (n % 2 == 0)
{
  Console.WriteLine(n + " = Even");
}
else
{
  Console.WriteLine(n + " = Odd");
}

//  6
//  6 = Even