Write a program that takes a series of numbers and counts the number of positive
and negative values.
Code: Select all
#include <windows.h>
#include <iostream>
using namespace std;
int main(){
int negative;
int posative;
int input; //number to check
negative = 0;
posative = 0;
while(1){
cout << "Negatives " << negative << " Posatives " << posative << '\n';
cout << "Enter Number: ";
cin >> input;
if (input <0)
negative++;
else if (input == 0)
cout << "0 is neither posative nor negative " << '\n';
else
posative++;
}
return (0);
}