I need an explanation.

I’m currently going through Bob Tabor’s MVA C# course and I’ve come across this question that I’m having some trouble wrapping my head around.

What will be written to the command window? int userValue = 2; string message = (userValue == 1) ? “boat” : “car”; Console.WriteLine(“{1} – {0}”, userValue, message) ;

I know the answer is “car – 2”, but I do not really understand why.

Can someone please explain to me?

submitted by /u/concreteyeti
[link] [comments]

Leave a Reply