Question #17429

Supposed that x = 1. Determine the value of the following expression and the value of x after the evaluation of the expression. (x > 1) && (x++ > 1)

Expert's answer

void function(int x) {

cout<< ((x > 1) && (x++ > 1)) << endl;

cout<< x << endl;

}

int main ()

{

function(1);

system("pause");

return0;

}

Results would be

0

1

cout<< ((x > 1) && (x++ > 1)) << endl;

cout<< x << endl;

}

int main ()

{

function(1);

system("pause");

return0;

}

Results would be

0

1

## Comments

## Leave a comment