Summary

Expressions and statements are used in programming languages to compute a value or return specific information.

Expressions comprise operators and operands. C# supports three kinds of operators: unary operators, binary operators, and the ternary operator.

Statements can be described as instructions, which direct the performance of specific actions. The statements supported by C# can be classified as selection statements, iteration statements, control transfer statements and the lock statement.

The selection statements consist of the if and switch statements. The for, while, do-while, and foreach statements are classified as iterations statements. Control transfer statements consist of the labeled, goto, break, continue and return statements. ...

Get Special Edition Using C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.