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 201 views
1 answer 193 views
1 answer 159 views
1 answer 142 views
1 answer 135 views
1 answer 165 views
...