The ternary operator
class MainClass
{
public static void Main()
{
int result;
result = 10 > 1 ? 20 : 10;
System.Console.WriteLine("result = " + result);
result = 10 < 1 ? 20 : 10;
System.Console.WriteLine("result = " + result);
}
}
Output result = 20
result = 10
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
|