I have used DEV-C++ compiler for debugging purpose. But you can use any C programming language compiler as per your availability.
#include<iostream>
using namespace std;
int main()
{
int num;
cout<<"Enter any number: ";
cin>> num;
if(num > 0)
cout<<"Enter number is positive";
else if(num < 0)
cout<<"Enter number is negative";
else
cout<<"Enter number is zero";
return 0;
}
I have used DEV-C++ compiler for debugging purpose. But you can use any C programming language compiler as per your availability.
Result:
Enter any number: -5
Enter number is negative
need an explanation for this answer? contact us directly to get an explanation for this answer