Level: Pre-intermediate (A2) Student types: adults. Target-typed conditional expression (C# 9. Student has to arrange the given words into the type zero conditional sentences.C# language specificationįor more information, see the Conditional operator section of the C# language specification.įor more information about features added in C# 7.2 and later, see the following feature proposal notes: IEnumerable xs = x is null ? new List() Ĭlassify = (input >= 0) ? "nonnegative" : "negative" Ī user-defined type cannot overload the conditional operator. If Jane (not/wear) a hat, she (get) sunstroke. If I (wake up) late, I (be) late for work. The conditional operator ?:, also known as the ternary conditional operator, evaluates a Boolean expression and returns the result of one of the two expressions, depending on whether the Boolean expression evaluates to true or false, as the following example shows: string GetWeatherDisplay(double tempInCelsius) => tempInCelsius 0.5 Zero Conditional () First Conditional(+) First Conditional (-) 100.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |