Here is source code of the C# Program to Find whether the Number is Divisible by 2. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
* C# Program to Find whether the Number is Divisible by 2
static void Main(string args)
Console.WriteLine("Enter the Number :");
n = int.Parse(Console.ReadLine());
if (n % 2 == 0)
Console.WriteLine("Entered Number is Divisible by 2 ");
Console.WriteLine("Entered Number is Not Divisible by 2");
Here is the output of the C# Program:
Enter the Number : 45 Entered Number is Not Divisible by 2
Sanfoundry Global Education & Learning Series – 1000 C# Programs.