C Program to check whether a given number is Positive or Negative
- #include <stdio.h>
- void main()
- {
- int num;
- printf("Enter a number: \n");
- scanf("%d", &num);
- if (num > 0)
- printf("%d is a positive number \n", num);
- else if (num < 0)
- printf("%d is a negative number \n", num);
- }
0 Comments
If you have any doubts, Please let me know