Ask Question
20 July, 17:07

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. 20 July, 19:01
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers