Positive or Negative Number in C
#include <stdio.h>
int main()
{
int n;
printf("Enter a Number :: \n");
scanf("%d", &n);
if (n > 0)
printf("%d is a Positive number \n", n);
else if (n < 0)
printf("%d is a Negative number \n", n);
}
OUTPUT
Enter a Number ::
5
5 is a Positive number
Enter a Number ::
-5
-5 is a Negative number
No comments:
Post a Comment
Please do not any spam link in Comment Box