C# Program to check if the Number is Odd or Even


This program in C# developed using .NET Framework 4.5 and Visual Studio 2013 will check if the entered number is a odd or even number. The Number is a even number if it is divisible by 2 and results with the reminder o0f zero.

C# Program to check if the Number is Odd or Even

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GinktageConsoleApp
    class Program
        static void Main(string[] args)
           int input;
           Console.Write("Enter the Number : ");

           input = int.Parse(Console.ReadLine());

           if (input % 2 == 0)

               Console.Write("The Number is an Even Number");         
               Console.Write("The Number is an Odd Number");           



If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply


Interesting BlogPosts to read

How to get an Enumerator from range of elements from ArrayList in C# ?
The code snippet shown in this blog post demonstrates how you can get the enumeraor from a range of ...
How to check for the column name in an SqlDataReader Object in C# ?
When working in ADO.NET for data access , there are times when you want to check to see if a column ...
How to add entries to ResourceDirectory in WPF using C# ?
Below is a sample code snippet demonstrating how the entries can be added to the ResourceDirectory i...