O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

The bulk of this chapter focused on the if-else and switch branching statements and their related language elements—the comparison and logical operators. Together they allow you to write decision-making programs that can react in different ways to different data.

The most important points discussed in this chapter are reviewed in this section.

A branching statement is a language construct that uses a given condition (Boolean expression) to decide between two or more alternative directions (branches) to follow in a program.

A program without any branching or iteration statements is executed sequentially, in the order (from top to bottom) that the statements are written in the source code.

The if statement is the fundamental branching statement ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required