Minor hijack: I know this can be done by using a single int instead of an array and overwriting the value, but is it also possible to do it without a storage variable (thus summing directly from the cin result, rather than store-then-sum)?
oh thank so very much..now i understand why it become 255 when i plus+plus=sum thank so much this very helpul ..this only for understanding the array .. im make a project using array restaurant .. when user input the list of food it will located the price that i make..so user only type how many food them want then it calculate it by itself..thank it very helpful