Answer to Question #13470 in C++ for vishal pathak
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
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment