#include<iostream>
using namespace std;
class posneg
{
private:
int n;
public:
void getdata();
void check();
};
void posneg::getdata()
{
cout<<"\nPOSITIVE OR NEGATIVE";
cout<<"\n--------------------";
cout<<"\nEnter any number :";
cin>>n;
}
void posneg::check()
{
if(n>0)
{
cout<<"\n"<<n<<" is POSITIVE Number";
}
else if(n<0)
{
cout<<"\n"<<n<<" is NEGATIVE Number";
}
else
{
cout<<"\n Zero is NEUTRAL";
}
}
int main()
{
posneg z;
z.getdata();
z.check();
return 0;
}
 

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: