How to use if shorthand operator inside Console.WriteLine with C#

1 Answer

0 votes
using System;
 
class Program
{
    static void Main() {
        int a = 13, b = 7;
 
        Console.WriteLine(a > b ? "yes" : "no");
       
        Console.WriteLine(a == b ? "yes" : "no");
    }
}
 
 
 
/*
run:
 
yes
no
 
*/

 



answered Sep 26, 2019 by avibootz

Related questions

1 answer 297 views
1 answer 284 views
1 answer 269 views
1 answer 246 views
1 answer 240 views
1 answer 273 views
...