Can someone help me solve this question. I've been stuck on it for quite a while now. The question is: Find the sum of 10 numbers, but will stop asking for a number if ZERO (0) is entered.
#include <iostream>
using namespace std;
int main()
{
float num, sum =0.0;
do {
cout << "Enter a number" <<endl;
cin >> num;
sum += num;
}
while (num !=0.0);
cout << "Total is:" << sum;
return 0;
}
Here's what I can do so far. Please tell me what to change so I can only insert 10 numbers