I am having trouble with debugging this code, I think I messed it up somewhere but I cant tell where. And every time I try debugging it a pop up says something about not being able to find the right file.
Here is the code:
#include <iostream>
using namespace std;
int main()
{
int number = 0;
int positive = 0; //counter
int negative = 0; //counter
cout << "Enter a positive or negative integer (enter 0 to end): ";
cin >> number;
while (number != 0)
{
//update counters
if (number > 0)
positive =+ 1;
else
negative =+ 1;
//end if
cout << "Enter another positive or negative integer (enter 0 to end): ";
cin >> number;
}//end while
cout << endl;
cout << "Total positive integers: " << positive << endl;
cout << "Total negative integers: " << negative << endl;
return 0;
} //end of main function
Well, if I got it right, you need to sum up negative and positive numbers. I believe the the error is pretty much when you sum them up. It should looks like this: