Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

How to check if input number is -ve or +ve in C/C++?

OpenStudy (anonymous):

main() { int x; if x>0 cout<<"Positive"; else if x<0 cout<<"Negative"; else cout<<"Zero"; getch(); } I think it should work.

OpenStudy (anonymous):

Sorry, after int x, you should get the input: cin>>x;

OpenStudy (anonymous):

:P that was easy.Sorry to bother you for that.

OpenStudy (anonymous):

No problem! :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!