Answer to Question #13470 in C++ for vishal pathak

Question #13470
Q.write a program to asked the user for a number. the program that print a line indicating that the number is greater than 0 or that is not.
1
Expert's answer
2012-08-28T10:28:44-0400
#include <iostream>
using namespace std;


void
main()
{
double x=0;
cout<<"Enter number:
"<<endl;
cin>>x;
if (x>0)

cout<<"Positive"<<endl;
if (x<0)

cout<<"Negative"<<endl;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS