Executable Statements
- Assignment Statements
- The = operator is used to assign a value to a memory location identified by an
identifier. The assigned value and the identifier must have the same datatype. In some
cases C++ implicitly promotes or truncates data values when the
data types of the assigned value and the identifier are not the same
- Expressions
- arithmetic and logical operators are used to perform the computations on the data.
Expressions involving variables of different data types results in vaariables being
promoted to the highest datatype in the expression. C++ evaluates expressions based on its
internally defined hierarchy of operations.
- Input and Output statements
- C++ treats inputs and outputs as streams. In order to perform input/output, the
data stream must be directed to the appropriate input/output stream object. cin
and cout are the standard input and standard output stream objects, respectively.
The extractor function >> is used to extract data from input
streams, and the insertor function << is used to insert data into
the output stream.
Back to Previous Page
Document:
Local Date:
Last Modified On: