Created
July 19, 2016 12:19
-
-
Save wohhie/3675d992c2cb949875be155e13e8ce54 to your computer and use it in GitHub Desktop.
C program to check whether a given integer is positive or negative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//C program to check whether a given integer is positive or negative | |
#include <stdio.h> | |
int main() { | |
int num; | |
printf("Enter a number: "); | |
scanf("%d", &num); | |
if (num >= 0) { | |
printf("This is Positive Number.\n"); | |
} | |
else { | |
printf("This is negative Number.\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment