Ask 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++;

+5
Answers (1)
  1. 25 April, 02:30
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers