Files
C-Projects/PositiveOrNegative.c
2021-06-23 16:52:39 -07:00

16 lines
353 B
C

// WAP to find out a given number is positive, negative or 0.
void main() {
int num;
printf("Input a number :");
scanf("%d", &num);
if (num >= 0)
printf("%d is a positive number \n", num);
else if (num == 0) {
printf("%d is zero \n", num);
}
else {
printf("%d is a negative number \n", num);
}
}