cout << "Enter a series of numbers (enter 0 to end ): ";
cin >> i;
while (i !=0) {
if (i>0) p++; else n++;
cin >> i;
}
cout << "\nThe number of positive numbers is: " << p << endl;
cout << "The number of negative numbers is: " << n << endl;
Hello Carl,
have a look at the below code , hope this is what you want
http://pastebin.com/4WjDTSyj
Make a program that would continue to ask for a series of number (e.g. 10 numbers). The program would do the following:
1. Count all positive numbers.
2. Count all negative numbers.
3. The program will terminate when it encounters a zero keyed in by the user.
a. use Do-While Loop.
b. use While Loop.
(IF POSSIBLE, please just edit my scratch :< )
Link: http://pastebin.com/gUXwY41J