Practice mode C Language

After the C statements int x = 5; int y = x++; what is the value of y?

Correct answer B. 5

Explanation

The post-increment x++ returns the old value of x before increasing it. So y receives 5, and only afterwards does x become 6.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.