Update appNew update is available. Click here to update.
Topics

Pointers Output

Easy
0/10

Problem statement

Figure out the correct output of the following code.

void changeSign(int *p){
  *p = (*p)  *  -1;
}

int main(){
  int a = 10;
  changeSign(&a);
  cout << a << endl;
}
Options: One or more answers may be correct