Answers for "c# sharp if and"

C#
1

c# if

int x;
int y;

if ( x == y)
	{
  		Console.WriteLine("x and y is equal");
	}
else
	{
  		Console.WriteLine("x and y is not equal");
	}

// Same, but shorter ( and harder XD )
Console.WriteLine($"x and y {(x == y? "is equal" : "is not equal")}");
Posted by: Guest on March-27-2021
0

c# if

if (20 > 18) 
{
  Console.WriteLine("20 is greater than 18");
}

/*
Less than: a < b
Less than or equal to: a <= b
Greater than: a > b
Greater than or equal to: a >= b
Equal to a == b
Not Equal to: a != b
*/
Posted by: Guest on July-01-2021

C# Answers by Framework

Browse Popular Code Answers by Language