Explain Increment operator

Increment operator: The operator (++) which adds one to its operand. It consists of two forms: pre-increment (++x) and post-increment (x++). In its pre-increment form, the outcome of the expression is the value of its argument subsequent to the increment. In its post-increment form, the outcome is the value of its argument previous to the increment is executed. Subsequent to the following,

    int a = 5, b = 5;
    int y,z;
    y = ++a;
    z = b++

y has the value of 6 and z has the value of 5. Both a & b have the value of 6.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.