04-if-else.c 252 B

123456789101112131415
  1. #include <stdio.h>
  2. int main() {
  3. int num;
  4. printf("Enter a number: ");
  5. scanf("%d", &num);
  6. if (num > 0) {
  7. printf("Positive number\n");
  8. } else if (num < 0) {
  9. printf("Negative number\n");
  10. } else {
  11. printf("Zero\n");
  12. }
  13. return 0;
  14. }