0
Where is the error in this C# code ?
Why its not print "yes" ? https://code.sololearn.com/c21jHNEbv170/?ref=app
5 Answers
+ 5
Console.WriteLine( a > b ? "yes" : "no" );
0
Jayakrishnađźđł thanks, it's working well..
can you just give me more complex examples ? I'm new in c sharp...
0
Complex examples of what?
Code practice or challenges?
0
Jayakrishnađźđł examples of this condition like print string without use console.write , I read this example and I can't get it
a > b ? "Yes" : "no"
0
I don't understanding your question.. without using console.write to print output?
The statement a > b ? "yes" : "no" ; is a ternary operator example, a shart form of if - else..
That if a > b is true then it executes 1st block after '?' otherwise, I. e a>b on false, then executes after ':' part. (that is else part..)
So a > b true then it return 'yes', if false it returns 'no'..