Given that two int variables , total and amount, have been declared , write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don’t forget to initialize total to 0.

Given that two int variables , total and amount, have been declared , write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don’t forget to initialize total to 0.

LANGUAGE: C++

CHALLENGE:

Given that two int variables , total and amount, have been declared , write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don’t forget to initialize total to 0.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level