0
Why is it adding the numbers up incorrectly
2 Réponses
+ 2
In another way of giving hint to you, you need to move one of your line to the bottom, just before cout.
+ 4
In the beginning, you declare five numbers. They are not initialized, so they contain unforeseeable values, just what's sitting at that point in memory right now.
You then define total as the sum of all these random numbers as they are now.
Then you take user input to put new values into the five number variables.
This has no influence on total, which still contains the sum of the former values.