csharp If Statement Syntax
if ((1).ToString() == "1")
{
Console.WriteLine("1 is equal to 1");
}
else
{
Console.WriteLine("You won't ever get here");
}
if ((1).ToString() == "1")
Console.WriteLine("1 is equal to 1");
else
{
Console.WriteLine("You won't ever get here");
}
if ((1).ToString() == "1")
{ Console.WriteLine("1 is equal to 1"); }
else
{ Console.WriteLine("You won't ever get here"); }
if ((1).ToString() == "1") { Console.WriteLine("1 is equal to 1"); }
else { Console.WriteLine("You won't ever get here"); }
if ((1).ToString() == "1")
Console.WriteLine("1 is equal to 1");
else
Console.WriteLine("You won't ever get here");
if ((1).ToString() == "1") Console.WriteLine("1 is equal to 1");
else Console.WriteLine("You won't ever get here");Examples of differing Syntax for an if statement - all of which are valid.
Updated: Friday 8th October 2010, 05:59pm
There are 0 comments
Comments are currently closed.