Positive or Negative
Write a program to check whether a given number is Negative or Positive.
Pictorial Explanation
Procedure
Get input from user.
If the input is zero, Print neither positive nor negative.
Else
If the input less than zero, print negative
else, print positive.
Example
Case 1
Input
10
Output
Positive
Case 2
Input
-13
Output
Negative
Case 3
Input
0
Output
Neither positive nor negative
Program
Example
#include<stdio.h> int main() { int num; scanf("%d",&num); if(num == 0) printf("Neither positive nor negative"); else if(num < 0) printf("Negative"); else printf("Positive"); return 0; }