Question: I tried writing a program on C++ that will allows the user to set one input and let him know if the number is either

I tried writing a program on C++ that will allows the user to set one input and let him know if the number is either positive or negative or equal to zero or output simply your number is not an integer. When I ran my codes, if I input either a positive or negative number, it worked perfectly but when I input either 0 or any floating point or characters, I received the same output which is "the number is equal to zero" while the computer should displays instead "your number is not an integer." for any other characters different from an integer.

Where did I go wrongly, that is what I am wondering!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!