Increment decrement

#include <stdio.h> int main ( void ) 
{ int I, J, K, m, n-, P; 
    I = . 8 ; 
    J = 10 ; 
    K = 12 is ; // increment before the operand 
     m = ++ I; 
     the printf ( " I D =% \ n- " , I);   // . 9 
     the printf ( " m D =% \ n- " , m);   // . 9 // increment operation after the 
     n- = J ++ ; 
     the printf ( " J D =% \ n- "


    


    


     
, J);   // . 11 
     the printf ( " n-D =% \ n- " , n-);   // 10 

     // decrement operation before 

     P = K - ; 
     the printf ( " K D =% \ n- " , K) ;   // . 11 
     the printf ( " P D =% \ n- " , P);   // 12 is 

     // mixing operation, initialize 

    K = 12 is ; 
    m = 14 ; 
    n- = . 5 ; 

    P = (m ++) * (n-++ ) + (- K);   // 15 * =. 11. 5 + 86;
    the printf ( " P D =% \ n- " , P); 

    / * * 
        (m ++) * (n-++) + (- K) 
        ==> (m ++ = m) * (= n-n-++) + ( = - K K) 
        ==> 15 * +. 11. 5 
        ==> 86 
    * / 
} 

/ * * 
    in the equation m = ++ i, the integer variable i of the self-energizing operation. Since the increment operator is placed before i, it is first to i are incremented, the value of i at this time is no longer 8, 9 but, since then assigned to the variable i after increasing m, so 9 outputs 
    the equation p = k--, the integer variable k for a decrement, since the decrement operator is placed after the k, it is first assignment operation, when p is 12, then then decrement operation, then reduced to 11 k 
    in the equation n = j ++, the integer variable j to be a self-add operation, since the self is placed after the addition operator j, it is to do an assignment, then n has a value 10, then self-add operation, then add 11 j 
* /

 

Guess you like

Origin www.cnblogs.com/starshine-zhp/p/12381350.html