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 293 views
1 answer 272 views
1 answer 264 views
1 answer 238 views
1 answer 232 views
1 answer 269 views
...