relational operators in C#
For Example: Program to demonstrate relational operators.
(Program
to check whether the Entered Number is even or odd)
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
namespace
ConsoleApplication18
{
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("Given Number
is an Even Number");
Console.Read();
}
else
{
Console.Write("Given Number is an Odd Number");
Console.Read();
}
}
}
}
Output:
Comments
Post a Comment