I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..
using System;
namespace csharpprograms
{
class Program
{
static void Main(string[] args)
{
int number;
Console.WriteLine("Enter a number: ");
number = Convert.ToInt32(Console.ReadLine());
// Even number if remainder is 0
if (number % 2 == 0)
Console.WriteLine("Entered Number is an Even Number");
else
Console.WriteLine("Entered Number is odd Number");
Console.ReadLine();
}
}
}
I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..
Result:
Enter a number:
20
Entered Number is an Even Number
need an explanation for this answer? contact us directly to get an explanation for this answer