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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started