Relational Operator
namespace
Realation_Operator_Program
{
class Program
{
static void Main(string[] args)
{
int
a;
int
b;
Console.WriteLine("Enter the value of A=");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the value of B=");
b = Convert.ToInt32(Console.ReadLine());
if
(a == b)
{
Console.WriteLine("Line 1- a is equal to b");
}
else
{
Console.WriteLine("Line 1 s - a is not equal to b");
}
if (a
< b)
{
Console.WriteLine("Line 2 - a is less than b");
}
else
{
Console.WriteLine("Line 2 is a is not less than b");
}
if
(a > b)
{
Console.WriteLine("Line 3 -a is greaterthan b ");
}
else
{
Console.WriteLine("Line 3 -a is not greater than b");
}
if
(a >= b)
{
Console.WriteLine("Line 4 -a is greater than or equal to b");
}
else
{
Console.WriteLine("Line 4 - a is not greater than or equal to b");
}
if
(a <= b)
{
Console.WriteLine("Line 4 -a is less than or equal to b");
}
else
{
Console.WriteLine("Line 4 - a is not less than or equal to b");
}
Console.ReadKey();
}
}
}
No comments:
Post a Comment