Chapter 02
Chapter 02
programming
IT1134
Chapter-02
C++
/* … */ Multiple-line comment
Name Meaning
std Where cin and cout are declared in
iostream header file
These are all predefined identifiers from the standard library. But
you can define your own identifiers.
Identifiers
C++ Tokens
On most newer compilers, the data types double and long dou
30
double: The data type double is used in C++ to represent any real
number between -1.7E+308 and 1.7E+308.The memory allocated
for the double data type is 8 bytes.
–5
In the expression
+27
+ is a unary operator.
Further, in the expressions
3 + 4
23 - 45
both the operators + and – are binary operators.
(((3 * 7) – 6) + ((2 * 5) / 4 )) + 6
= ((21 – 6) + (10 / 4)) + 6
(Evaluate *)
= ((21 – 6) + 2) + 6 (Evaluate /. Note
that this is an integer division.)
= (15 + 2) + 6
(Evaluate –)
= 17 + 6
(Evaluate first +)
= 23
(Evaluate +)
Expressions
2 + 3 * 5
3 + x - y / 7
x + 2 * (y - z) + 18