Ask Question
23 December, 22:21

In which of the following is "y" not equal to 5 after execution? X is equal to 4.

a) y = + +x; b) y = x = 5; c) y = 5; d) y = x++;

+3
Answers (1)
  1. 24 December, 01:06
    0
    d) y=x++

    Explanation:

    In all 3 statements:

    y = + +x;

    y=x=5;

    y=5;

    The value of y is equal to 5.

    However in the statement y=x++, the value of 5 is equal to value of x prior to the increment operation. The original value of x was 4. So the value of y will be 4. Note that after the statement execution, the value of x will be updated to 5. In effect y=x+ + can be visualized as a sequence of following steps:

    x=4;

    y=x;

    x=x+1;
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “In which of the following is "y" not equal to 5 after execution? X is equal to 4. a) y = + +x; b) y = x = 5; c) y = 5; d) y = x++; ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers