PositiveOrNegative

This commit is contained in:
2021-04-27 10:31:42 +05:30
parent b1073218fa
commit 3d26196d7b
3 changed files with 17 additions and 1 deletions

15
PositiveOrNegative.c Normal file
View File

@@ -0,0 +1,15 @@
// 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);
}
}