3

Controlling Flow, Converting Types, and Handling Exceptions

This chapter is all about writing code that performs simple operations on variables, makes decisions, performs pattern matching, and repeats statements or blocks. You will also learn how to work with arrays to store multiple values, how to convert variable or expression values from one type to another, how to handle exceptions, and how to check for overflows in number variables.

This chapter covers the following topics:

  • Operating on variables
  • Understanding selection statements
  • Understanding iteration statements
  • Storing multiple values in an array
  • Casting and converting between types
  • Handling exceptions
  • Checking for overflow

Operating on variables

Operators apply simple operations ...

Get C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals - Eighth Edition 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.