
we have two different variables named a
.
Inside the if
statement, all occurrences of a
refer to the floating point a
that is declared at the beginning
of that block.
The a
which is being returned in the last line of the body
is the integer a
that is declared at the top of the function
body.
We discuss this only to make you aware that it is possible and
to recognize what's happening if you see it.
We don't find it to be a particularly recommendable feature to
use.
Block Structured Control Flow
The blocks also give us an important way to think about
the control flow.
Notice that any of the figures that we used to illustrate
control flow structures can themselves have a box put around
them and they can be used any place we have other boxes.
One effect of this is that all control flow constructs are
in a sense self-contained.
Other factors to notice include:
- Each block has one entrance at the top and one exit at
the bottom.
- Once control enters at the top of a block, it continues
within the block until it leaves at the bottom.
Control never leaves and then returns to the block.
- The blocks can always be arranged so that the lines
connecting them never cross each other.

That concludes Part 3.
You may return to the index
or move on to the next part.