Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

positive negative c++

#include<iostream>
using namespace std;

int main()		{
	
	int x;
	cout << "Enter a number:";
	cin >> x;
		if (x<0)
			{
				cout <<x<<" is a negative number.";
			}
				else if (x>0)
			{
				cout <<x<< " is a positive number.";
			}
	return 0;
				}
 
PREVIOUS NEXT
Tagged: #positive #negative
ADD COMMENT
Topic
Name
7+4 =