Chapter 03

Controlling Flow and Converting Types

This chapter is all about writing code that performs simple operations on variables, makes decisions, repeats blocks of statements, converts variable or expression values from one type to another, handles exceptions, and checks for overflows in number variables.

This chapter covers the following topics:

  • Operating on variables
  • Understanding selection statements
  • Understanding iteration statements
  • Casting and converting between types
  • Handling exceptions
  • Checking for overflow

Operating on variables

Operators apply simple operations such as addition and multiplication to operands such as variables and literal values. They usually return a new value that is the result of the operation that can be ...

Get C# 8.0 and .NET Core 3.0 - Modern Cross-Platform Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.