# Computer Science : Post-Conditions

## Example Questions

### Example Question #1 : Post Conditions

double square(double n){

return n*n;

}

What MUST be true immediately after the above code snippet has run?

The result will be a negative number.

The result will be stored in a new variable.

The value of the input parameter changes.

It is impossible to tell.

The result will be a positive number.

The result will be a positive number.

Explanation:

Squaring a real number will always produce a positive number. The result does not have to be stored in a new variable; it could be a value that is only needed for a one-off expression, thus, not worthy to be stored in memory. Lastly, since the input was passed by value and not by reference, its initial value will stay the same.