Write a program in C++ to check whether a number is positive, negative or zero

Write a program in C++ to check whether a number is positive, negative or zero




#include<iostream>
using namespace std;
int main()
{
 float x;
 cout<<"Enter your number :";
 cin>>x;

 if (x>0)
 {
  cout<<"The entered number is Positive";
 } else if (x<0)
 {
  cout<<"The entered number is Negative";
 } else {
  cout<<"The entered number is 0 ";
 }

}

Write a program in C++ to check whether a number is positive, negative or zero