Introduction
-
Operator ">" to compare two variable or values and see if one is bigger.
-
Operator "<" to compare two variable or values and see if one is smaller.
-
Operator "==" is use to compare two things are equal.
-
Operator "!=" is use to compare two things are not equal.
-
You can combine individual tests into one long test using the && operator for AND.
-
You can combine individual tests into one long test using the || operator for OR.
Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace condiction_operator
{
class Program
{
static void Main(string[] args)
{
int a = 10;
int b = 15;
int c = 10;
if (a > b) //greater then operator
{
Console.WriteLine("a is greater then b");
}
else
{
Console.WriteLine("a is less then to b");
}
if (a < b) // less then operator
{
Console.WriteLine("a is less then to b");


Join the conversation! Your thoughts help the community grow.