Tech Study

Write Odd Even Program in C#

Introduction :

Odd Even Program in C#

Write C# Program to check whether entered number is odd or even. 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();
 
        }
    }
}

Result

Write C# Program to check whether entered number is odd or even
Write odd even program in c#

To know more about c# visit these links:

C# Program to convert days to years, weeks and days

C# Program to Multiply two Floating Point Numbers

TaggedWrite C# Program to check whether entered number is odd or even

Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more