Skip to content

Instantly share code, notes, and snippets.

@ugandapinik
Created July 19, 2016 12:19
Show Gist options
  • Save ugandapinik/3675d992c2cb949875be155e13e8ce54 to your computer and use it in GitHub Desktop.
Save ugandapinik/3675d992c2cb949875be155e13e8ce54 to your computer and use it in GitHub Desktop.
C program to check whether a given integer is positive or negative
//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