Explanation: This Program will help you to find number is positive, negative or Zero. First, we include the library required for I/O operations.
We declare an integer variable num to store the user’s input.
We ask the user to input and display a number.
If num is more than zero, we verify it and output the result indicating that it is positive.
We print that num is negative if it is less than zero.
We determine that the number is zero and print that if neither of the conditions is satisfied.
#include <stdio.h>
int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (num > 0) {
printf("The number is Positive.\n"); // If the number is greater than 0.
} else if (num < 0) {
printf("The number is Negative.\n"); // If the number is less than 0.
} else {
printf("The number is Zero.\n"); // If the number is neither.
}
return 0;
}