total, sum program

I have basically just started learning c++ and I am trying to create a program that allows the user to enter numbers and everytime a total will be give, however,I seem to be having a problem with it looping, any help would be appreciated. thanks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using namespace std;

int main()

{
	float num;
	float total;
	total = 0;


	do {
		cout << "Enter a number" << endl;
		cin >> num;
		total = total + num;
		cout << total << endl;
	} while (num = 00);



	system("pause");
	return 0;
}
} while (num = 00);

Should be :
} while (num == 00);
When you compare a value to a value, use the equality comparison operator (==) not assignment operator (=).
I changed it to == but still not looping
Well,
} while (num != 00);
When you enter '0', the loop will terminate.
omg of course. foolish mistake. thanks for pointing it out
Topic archived. No new replies allowed.