Why do you have this:
while (std::cin >> value)
??
This is all you need (IMO):
Code:
#include <iostream>
using namespace std;
int main( void )
{
int value;
cin >> value;
if ( valie < 0 ) cout<< "NEG!";
else if ( value > 0 ) cout<< "POS!!";
else if ( value == 0 ) cout<< "ZERO!";
else cout<< "I don't know what's wrong!";
return 0;
}
I you had the while loop there so that you could do it a lot, all you need do is the following:
Code:
#include <iostream>
using namespace std;
int main( void )
{
int value = 1;
while ( value > 0 )
{
cin >> value;
// Do stuff with value here!
}
return 0;
}
EDIT - all compiled with MS Notepad, so ware or warnings and errors!