Search This Blog

Friday, March 19, 2010

Is the integer positive or negative

I needed a lil proggie to refresh my skillz.
All it does is tell you if the integer is positive or negative.
Not much, but I don't give a shit.
C++.










//number gen #2 by Trevor
#include
using namespace std;


int main()
{
int x;
cout<<"Press 0 to end.\n\n";
while (x!=0){
cout<<"Enter da numba: ";
cin >>x;
if (x > 0)
cout << "x is positive\n"<
else if (x <>
cout << "x is negative\n"<
}


system("PAUSE");
}




No comments:

Post a Comment