programming-examples/c-sharp/_Basic/C# Program to Check whether the Entered Number is Even or Odd.cs

34 lines
726 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Check whether the Entered Number is Even or Odd
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace check1
{
class Program
{
static void Main(string[] args)
{
int i;
Console.Write("Enter a Number : ");
i = int.Parse(Console.ReadLine());
if (i % 2 == 0)
{
Console.Write("Entered Number is an Even Number");
Console.Read();
}
else
{
Console.Write("Entered Number is an Odd Number");
Console.Read();
}
}
}
}
/*
Enter a Number : 25
Entered Number is an Odd Number