DekGenius.com
Team LiB   Previous Section   Next Section

5.6 Statements

In C#, a complete program instruction is called a statement. Programs consist of sequences of C# statements, each of which must end with a semicolon (;). Here are three statements:

int myVariable;                      // a statement
myVariable = 23;                     // another statement
int anotherVariable = myVariable;    // yet another statement

C# statements are evaluated in order. The compiler starts at the beginning of a statement list and makes its way to the bottom. This would be entirely straightforward, and terribly limiting, were it not for branching. Branching allows you to change the order in which statements are evaluated. See Chapter 6 for more information about branching.

    Team LiB   Previous Section   Next Section