AWK also supports the increment ++ and decrement -- operators; they increase or decrease the value of a variable by one. Both operators are similar to the operators in C. These operators can only be used with a single variable and, thus, only before or after the variable. They are the short forms of some common operations of adding and subtracting.
Pre-increment:
It is represented by the plus plus (++) symbol prefixed to the variable. It increments the value of an operand by one. Let's say we have a variable, var; to pre-increment its value, we write ++var. It first increments the value of operand and then returns the incremented value. In the following example, we use two variables, p =5 and q = ++p. Here, first the value is incremented and then it is assigned. So, the pre-increment sets both the operands p and q to 6. It is equivalent...