volume_mute

Two variables are aliases

publish date2022/06/03 12:02:00 GMT+10

volume_mute

Variable named sum and totalwhere both are aliases.  If the following operations are made to total, what is the value of sum?

sum = 1
total = 2
total = total + 3
3
1
3
5

Correct Answer

5

Explanation

It is 5 because they are aliases, means referring to the same memory location.

Reference

Concepts of Programming languages, 10th ed, go-math-science.com


Quizzes you can take where this question appears