Integer updating (C++) | Sololearn: Learn to code for FREE!

+1

Integer updating (C++)

lets say I have made 2 integers, (x and y), which are both the number 4. If I make another integer (sum) that is x + y and I print it, it will print 8. But if I then change x to 5 and print the int sum again, will it say 9 or will it still think x = 4 and say 8?

c++

8/24/2017 3:13:06 PM

ReimarPB

2 Answers

New Answer

+2

Sum will become 9 as long as the variables x and y are assigned their values above sum, and the program is run again after making the changes.

+2

@Zeke Williams thanks!