Thursday, July 18, 2019

Check Number positive or Negative in c

Check Number positive or Negative in c:

check number positive or negative in c



#include<stdio.h>
#include<conio.h>
void main()
{
   int a;
   clrscr();
   printf("Enter the value of a:-");
   scanf("%d", &a);
   if(a==0)
   {
      printf("Zero");
   }
   else if(a<0)
   {
     printf("Negative");
   }
   else
   {
      printf("Possitive");
   }
   getch();
}

Output:



EmoticonEmoticon