One important side effect of grouping statements between braces is that the code defined within the braces is relevant only to other code also between the braces. This is called scoping and is of particular interest when defining variables that can be used by the code.
Recall that variables are places to store information. Local variables are relevant right now, and global variables are relevant to the whole program. The scope of a global variable is the whole source file in which it appears.
However, a variable that is declared inside a code block may be used only inside that code block or any other code blocks that might exist within it. It is said to be local.
The variable cannot be used in other code blocks that are not ...