In this example, we concentrate
on variables, data declarations, and simple operations on integers and
Variables must be declared
(lines 5-6) and associated with a data type.
Unlike pseudocode, C++
has a very precise syntax that must be followed.
Comments begin with //
in C++. They are part of the white space, which is irrelevant to
the meaning of the program other than for readability. Line numbers
are not part of the text and will not be present in future examples.
arrow <- has been replaced with the C++ syntax =.
Statements always end
with a semicolon ;.
Last Updated 01/05/2000