Ternary Operator
A single line if/else statement.
What is the ternary operator?
A single line if/else statement.
double chocolate = 2.50;
double donuts = 3.99;
double maxPrice = (chocolate > donuts) ? chocolate : donuts;
Level: Apprentice · More C# terms at this level
Updated