cout << "Please enter a number" << endl;
cin >> i;
if (i < 0)
{ cout << "The number you entered is negative.\n";}
if (i = 0)
{ cout << "The number you entered is zero.\n";}
if (i > 0)
{ cout << "The number you entered is positive.\n";}
else
{ cout << "Thank you for using this program.\n";}
return 0;
}
I just want to have the program print if the number is 0, negative or positive. The code works with no errors but all it does is ask for a number, and when you hit enter it says Thanks...What am I doing wrong? I've been on this for 2 hours! HELP.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.