Problem trying to add a list of numbers.

using namespace std;

int main()
{ double max, count;
bool x;
cout<<"Please input the maximum value: ";
for(count=2; count<=max; count+=2){
cout<<" ";
cout<<"\nWould you like to go again? (1=yes 0=no): ";
return 0;

Basically I need the code to give the sum of the cubes of the even numbers between 2 and a chosen maximum value. Right now, all I can get it to do is give a list of the cubes. I don't know how to add these numbers up. Please help!
Variable x

bool x;

is not initialized. So the behavior of the program is undefined.

As for your problem then you should define a variable of type long double and add to it your numbers.
Topic archived. No new replies allowed.