#include <iostream>using namespace std;//The main functionint main(){ int a = 0; int positivesum = 0; int negativesum = 0; while(1) { cout<<"Enter the number: “; cin>>a; if(a>0) { positivesum += a; } else { negativesum += a; } cout<<"Result: "<<sum<<endl; } //system("pause");return 0;}
Comments