When we write X=10 and Y=X, which of the following memory assignment is correct
Answers
Answered by
2
Answer:
X= 10 is the correct one
Answered by
14
Answer:
X and Y will have two distinct locations and 10 will be stored in both.
Explanation:
When the line asks the variable X to store 10 in it, it stores the value of 10 in the variable X. Then after the value of 10 is stored in the variable X, the next like or statement states that the value of X to be transferred to the value of Y or to be stored in the variable Y. Therefore, in conclusion, we can see that both X and Y are different variable, but the value stored in them is the same which is 10.
Similar questions