less than or equal to c# code example
Example 1: c# is not equal to
int a = 1;
int b = 2;
if (a == b) {
Console.WriteLine("A and b have the same value stored in them!");
else if (a != b) {
Console.WriteLine("A and b do not have the same value stored in them!");
}
Example 2: c# switch case greater than
int mark = 50;
switch (mark)
{
case int n when n >= 80:
Console.WriteLine("Grade is A");
break;
case int n when n >= 60:
Console.WriteLine("Grade is B");
break;
case int n when n >= 40:
Console.WriteLine("Grade is C");
break;
default:
Console.WriteLine("Grade is D");
break;
}