Kamis, 09 Februari 2012

Operators in Language C/C++ Part 2

On entry this time, I will continue the subject in the previous post operator, In previous posts we've talked about arithmetic operators, and now we will discuss about the Increment and decrement operators, and Operator Relations (Comparative).

A. Increment and decrement operators.
>> In C + + programming, providing an addition and decrement operators (Increment & decrement).


>> A = A + 1 or A = A - 1; can be simplified to  A + = 1 or  A - = 1 and can be simplified to A++ or A--, the notation ++ or --  can be put in front of or behind the variable.
Example: A-- or --A and A++ or ++A These two forms of writing above has a different meaning:
  • If placed in front of the variable. Then the addition or subtraction will be done just before or immediately at the time of encounter, leaving the variable value change once was going to direct this expression is encountered.
  • If placed on the back of the variables. Then the addition or subtraction will be performed after this look at the encounter or the value of the variable will be fixed when the expression is found.
<> Examples of Use of Notation Increment Program (enhancer) and decrement (reduction) in Front of variables.


<> Use of Notation Output Increment Program (enhancer) and decrement (reduction) in Front of variables.

<> Examples of Use of Notation Increment Program (enhancer) and decrement (reduction) in the Rear Variable

<> Use of Notation Output Increment Program (enhancer) and decrement (reduction) in the Rear Variable.


2. Operation Relations (Comparative).
The operator of this relation is used to compare two values. The results of the comparison operator is a numeric value 1 (True) or 0 (False).

<> Example Program Relations (Comparative)

<> Output Relations Program (Comparison)


Tidak ada komentar:

Posting Komentar