• + 0 comments

    void update(int *a,int *b) { int x = *a + *b; //initializing pointers addition inside variable. int diff = *a - *b; //initializing pointers difference inside variable.

    if(diff < 0){
        diff = -diff;        //or you can use the abs( ) function for mod.
    }
    
    *a = x;
    *b = diff;
    

    }