Expressions in C++ An expression in C++ is any valid combinations of operators, constants and variables . The expressions in C++ can be of any type :
- Arithmetic Expression
- Relational Expression (or Logical Expression)
- Compound Expressions etc.
Logical Expressions are the expressions that results o(false) or 1(True). These expressions are combination of constants, variables and logical and relational operators.
Examples of some valid Logical Expressions are –
Assignment Statements – These statements assigns a value to a variable. The value assined may be a constant variable or an expression. These can be chained together also.
For Example,
In the above chained assignment statement, value 13 is assigned to all the variables x,y,z. Firstly, 13 is assigned to z, then the new value of z is assigned to y, and finally the new value of y is assigned to x.
]]>