[Message Deleted]
-
Hi,
(condition ? result_if_true : result_if_false)
represents a value...Console.WriteLine(x > y ? "X bigger" : "Y bigger (or equal to)");
is what you're looking for (note that if x > y is false... it doesn't necessarily mean that y > x). Hope this helps.Matthew Butler
-
Hi,
(condition ? result_if_true : result_if_false)
represents a value...Console.WriteLine(x > y ? "X bigger" : "Y bigger (or equal to)");
is what you're looking for (note that if x > y is false... it doesn't necessarily mean that y > x). Hope this helps.Matthew Butler
-
Yuo are calling the
WriteLine
method ofConsole
which is not an:Laddie wrote:
assignment,call,increment, decrement, and new object expressions
Try:
if (x > y) { Console.WriteLine("x is greater"); } else { Console.WriteLine("y is greater"); }
You always pass failure on the way to success.