Answers for "how to write a if statement in C#"

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

Code answers related to "how to write a if statement in C#"

C# Answers by Framework

Browse Popular Code Answers by Language