Answers for "simple 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
1

if statement conditions c#

int myVar = 0;

if (myVar > 3)
{
	//do code
}
Posted by: Guest on March-04-2020

C# Answers by Framework

Browse Popular Code Answers by Language