004 If-Statement With Comparison Operators and Logical Operator Example

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

/*************************************************************************

* If-Statement with Comparison Operators and Logical Operator Example


*
*************************************************************************/
using System;
namespace MyProject.Examples
{
class ExampleOne
{
static void Main()
{
int num1, num2;
//Accepting Values from users
Console.Write("Enter first number\t\t");
num1 = Convert.ToInt32(Console.ReadLine());

Console.Write("\n\nEnter second number\t\t");


num2 = Convert.ToInt32(Console.ReadLine());

if(num1<num2 || num1==20)
{
Console.Write("num1 is less then num2 or num 1 is
20\t\t");
}
else if (num1 == num2)
{
Console.Write("num1 is = num2\t\t");
}
else
{
Console.Write("num1 is gererat then num2\t\t");
}

Console.ReadKey();
}
}
}

You might also like