Input a number and check whether it is positive, negative or zero?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Input a number and check whether it is positive, negative or zero??

Pls ANSWER IT I NEED THE PROBLEM!!

12th Jul 2016, 4:44 PM
Mohammed shibili
Mohammed shibili - avatar
2 Answers
0
//I think you can write the basic parts I'll start directly from logic int a; cin>>a; if(a>0)cout<<"positive"; else if(a<0)cout<<"negative"; else cout<<"zero";
12th Jul 2016, 8:29 PM
Vedant Patadia
Vedant Patadia - avatar
0
int n = 0; cin>>n; (n <0 ) ? cout<<"negative" : cout<<"positive";
13th Jul 2016, 5:22 AM
Rafael Marroquin
Rafael Marroquin - avatar