A computer program is a compilation of instructions called statements. There are many types of statements in C# and some—such as if, while, for, and switch—are conditional statements that determine the flow of the program. This chapter discusses C# statements, starting with an overview and then providing details of each of them. The return statement, which is the statement to exit a method, is discussed in Chapter 4, “Objects and Classes.”
In programming, a statement is an instruction to do something. Statements control the sequence of execution of a program. Assigning a value to a variable is an example of a statement.
x = z + 5;
Even a variable declaration is a statement.
long secondsElapsed; ...